From c15cd2af398b82e12ba820d8e627c2f7e637fc9c Mon Sep 17 00:00:00 2001 From: PiZZAD0X Date: Sat, 31 Aug 2019 13:58:48 -0700 Subject: [PATCH] Hostage PreInit, Ace Actions --- addons/hostage/CfgEventHandlers.hpp | 9 +++++++++ addons/hostage/XEH_preClientInit.sqf | 10 ++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/hostage/CfgEventHandlers.hpp b/addons/hostage/CfgEventHandlers.hpp index be284a9..adbceff 100644 --- a/addons/hostage/CfgEventHandlers.hpp +++ b/addons/hostage/CfgEventHandlers.hpp @@ -8,5 +8,14 @@ class Extended_PreStart_EventHandlers { class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); + clientinit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); + }; +}; + +class Extended_InitPost_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE(call FUNC(InitPost)); + }; }; }; diff --git a/addons/hostage/XEH_preClientInit.sqf b/addons/hostage/XEH_preClientInit.sqf index 430fdfa..a449450 100644 --- a/addons/hostage/XEH_preClientInit.sqf +++ b/addons/hostage/XEH_preClientInit.sqf @@ -4,16 +4,14 @@ params ["_unit"]; private _condition = { params ["_target", "_player"]; - LOG_2("_statement %1, %2",_target,_player); - (!(GETVAR((_this select 0),IsRescued,false)) - && !(GETVAR((_this select 0),IsUntied,false)) - && {(alive (_this select 0))}) + (!(GETVAR(_target,IsRescued,false)) + && {!(GETVAR(_target,IsUntied,false))} + && {(alive _target)}) }; private _statement = { params ["_target", "_player"]; - LOG_2("_statement %1, %2",_target,_player); [_target,_player] call FUNC(Rescue); }; - private _rescueaction = ["RescueHostage", "Rescue Hostage","",_statement,_condition] call ace_interact_menu_fnc_createAction; + private _rescueaction = ["RescueHostage", "Untie Hostage","",_statement,_condition] call ace_interact_menu_fnc_createAction; [_unit, 0, ["ACE_MainActions"], _rescueaction] call ace_interact_menu_fnc_addActionToObject; }] call CBA_fnc_addEventHandler;