A3XAI-Final/A3XAI/compile/A3XAI_noAggroAreaToggle.sqf
Snark Industries c4a7084754 A3XAI Final Release (April 17, 2016 version)
Releasing previously unreleased version. Completely unsupported with no guarantee of functionality. Use at own risk.
2017-07-19 21:20:00 -04:00

32 lines
1.2 KiB
Plaintext

#include "\A3XAI\globaldefines.hpp"
private ["_unitGroup", "_object", "_nearNoAggroAreas", "_inNoAggroArea", "_objectPos","_combatMode"];
_unitGroup = _this select 0;
_inNoAggroArea = _this select 1;
_combatMode = (combatMode _unitGroup);
if (_inNoAggroArea) then {
if !(_unitGroup call A3XAI_getNoAggroStatus) then {
[_unitGroup,true] call A3XAI_setNoAggroStatus;
if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: Group %1 set no-aggro status ON.",_unitGroup];};
};
if (_combatMode != "BLUE") then {
[_unitGroup,"Nonhostile"] call A3XAI_forceBehavior;
//if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: Group %1 in no-aggro zone.",_unitGroup];};
}
} else {
if (_unitGroup call A3XAI_getNoAggroStatus) then {
[_unitGroup,false] call A3XAI_setNoAggroStatus;
if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: Group %1 set no-aggro status OFF.",_unitGroup];};
};
if (_combatMode isEqualTo "BLUE") then {
[_unitGroup,"Default"] call A3XAI_forceBehavior;
[_unitGroup,false] call A3XAI_setNoAggroStatus;
//if (A3XAI_debugLevel > 1) then {diag_log format ["A3XAI Debug: Group %1 exited no-aggro zone.",_unitGroup];};
};
};
true