2017-04-26 20:05:40 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
|
|
|
PREP_RECOMPILE_START;
|
|
|
|
#include "XEH_PREP.hpp"
|
|
|
|
PREP_RECOMPILE_END;
|
|
|
|
|
2019-03-24 05:37:39 +00:00
|
|
|
#include "initSettings.sqf"
|
|
|
|
|
2019-09-05 20:56:14 +00:00
|
|
|
// Add vanilla killed EH to unit to set correct killer
|
|
|
|
["CAManBase", "init", {
|
|
|
|
params ["_unit"];
|
|
|
|
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _unit;
|
2019-09-05 20:56:14 +00:00
|
|
|
if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
|
|
|
|
if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
|
|
|
|
|
|
|
|
// Hopefully this EH gets added first as it can only effect other EH called after it
|
|
|
|
private _ehIndex = _unit addEventHandler ["Killed", {_this call FUNC(handleKilled)}];
|
|
|
|
#ifdef DEBUG_MODE_FULL
|
|
|
|
if (_ehIndex != 0) then { WARNING_1("killed EH not first [%1]",_ehIndex); };
|
|
|
|
#endif
|
|
|
|
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
2020-02-29 22:09:00 +00:00
|
|
|
addMissionEventHandler ["EntityKilled", {_this call FUNC(handleKilledMission)}];
|
|
|
|
|
2021-03-03 21:50:08 +00:00
|
|
|
if (hasInterface) then {
|
2021-03-03 21:30:49 +00:00
|
|
|
//Add Inventory action to uncon units
|
|
|
|
["CAManBase", "init", {
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
private _id = _unit addAction ["", {
|
|
|
|
params ["_target", "_caller", "_actionId", "_arguments"];
|
|
|
|
|
|
|
|
_caller action ["Gear", _target];
|
|
|
|
}, nil, 5.1, true, true, "gear", "_target getVariable ['ACE_isUnconscious',false] && {alive _target}", 3.5];
|
|
|
|
|
|
|
|
_unit setUserActionText [_id, localize "STR_ACTION_GEAR", "<img image='\A3\ui_f\data\igui\cfg\actions\gear_ca.paa' size='2.5' shadow=2 />"];
|
|
|
|
|
|
|
|
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
|
|
|
|
};
|
|
|
|
|
2017-04-26 20:05:40 +00:00
|
|
|
ADDON = true;
|