Common - Don't add UAV AI to localUnits array (#6951)

* Common - Don't add UAV AI to localUnits array

* Update addons/common/functions/fnc_setupLocalUnitsHandler.sqf

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
PabstMirror 2019-04-25 13:30:43 -05:00 committed by GitHub
parent 15401468b9
commit 83cd316b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: dedmen
* Adds the local unit event handlers.
* Adds the local unit event handlers.
* Access with function `ace_common_fnc_getLocalUnits` or array `ace_common_localUnits`
*
* Arguments:
@ -15,6 +15,8 @@
*
* Public: No
*/
// Ignore UAV/Drone AI
#define IGNORE_BASE_UAVPILOTS "B_UAV_AI", "O_UAV_AI", "UAV_AI_base_F"
GVAR(localUnits) = [];
@ -27,7 +29,7 @@ GVAR(localUnits) = [];
if (!alive _unit) exitWith {};
GVAR(localUnits) pushBack _unit;
};
}] call CBA_fnc_addClassEventHandler;
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
["CAManBase", "respawn", {
params ["_unit"];
@ -37,7 +39,7 @@ GVAR(localUnits) = [];
if (!alive _unit) exitWith {};
GVAR(localUnits) pushBack _unit;
};
}] call CBA_fnc_addClassEventHandler;
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
["CAManBase", "local", {
params ["_unit", "_local"];
@ -49,7 +51,7 @@ GVAR(localUnits) = [];
} else {
GVAR(localUnits) deleteAt (GVAR(localUnits) find _unit);
};
}] call CBA_fnc_addClassEventHandler;
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
["CAManBase", "deleted", {
params ["_unit"];
@ -64,7 +66,7 @@ GVAR(localUnits) = [];
};
}, [_unit]] call CBA_fnc_execNextFrame;
};
}] call CBA_fnc_addClassEventHandler;
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
["CAManBase", "killed", {
params ["_unit"];
@ -73,4 +75,4 @@ GVAR(localUnits) = [];
if (local _unit) then {
GVAR(localUnits) deleteAt (GVAR(localUnits) find _unit);
};
}] call CBA_fnc_addClassEventHandler;
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;