mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
adc7db9ae9
Still some small head movements, but I don't know how to fix that.
38 lines
936 B
Plaintext
38 lines
936 B
Plaintext
/*
|
|
* Author: Glowbal, KoffeinFlummi
|
|
* Disables/Enables AI
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Disable AI <BOOL>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [bob, true] call ace_common_fnc_disableAI;
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
PARAMS_2(_unit,_disable);
|
|
|
|
if ((local _unit) && {!([_unit] call EFUNC(common,isPlayer))}) then {
|
|
if (_disable) then {
|
|
_unit disableAI "MOVE";
|
|
_unit disableAI "TARGET";
|
|
_unit disableAI "AUTOTARGET";
|
|
_unit disableAI "FSM";
|
|
_unit disableConversation true;
|
|
} else {
|
|
//Sanity check to make sure we don't enable unconsious AI
|
|
if (_unit getVariable ["ace_isunconscious", false]) exitWith {ERROR("Enabling AI for unconsious unit");};
|
|
_unit enableAI "MOVE";
|
|
_unit enableAI "TARGET";
|
|
_unit enableAI "AUTOTARGET";
|
|
_unit enableAI "FSM";
|
|
_unit disableConversation false;
|
|
};
|
|
};
|