ACE3/addons/medical_status/XEH_preInit.sqf
Grim 36f34ec551
Medical - Add 'Open (Backpack)' action to dead units (#9239)
* add open bag interaction

* only add actions to uncon/dead

* improve assembly backpack check

* Fixes

* Removed test code

* move to postInit

* fix locality

* locality edge case

* Fix double actions on dead units

* improve comment

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-03 21:48:09 -04:00

29 lines
972 B
Plaintext

#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
// Add vanilla killed EH to unit to set correct killer
["CAManBase", "init", {
params ["_unit"];
private _config = configOf _unit;
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;
addMissionEventHandler ["EntityKilled", {_this call FUNC(handleKilledMission)}];
ADDON = true;