diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index ea2e104de5..dfcf84e443 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -23,4 +23,6 @@ try { } catch { HANDLECATCH; }; -_val + +if (isNil "_val") exitWith { nil }; +_val; diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index df91f3ac77..9f6f6489d0 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -23,4 +23,6 @@ try { } catch { HANDLECATCH; }; + +if (isNil "_hash") exitWith { nil }; _hash; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index e828c60912..e5b2e99291 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -51,7 +51,7 @@ private ["_team"]; if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; // Statement - [ACE_player, cursorTarget] call FUNC(tapShoulder); + [ACE_player, cursorTarget, 0] call FUNC(tapShoulder); true }, {false}, diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 510fa4497f..23391651cc 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Player * 1: Target + * 2: Shoulder which was tapped * * Return value: * None @@ -16,7 +17,7 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); +PARAMS_3(_tapper,_target,_shoulderNum); if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 5750ab52d6..7d145c8421 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -66,7 +66,7 @@ class CfgVehicles { }; class ModuleCurator_F: Module_F { - function = QUOTE(DFUNC(moduleCuratorDelay)); + function = QUOTE(DFUNC(bi_moduleCurator)); }; class ModuleMine_F: ModuleEmpty_F { function = QUOTE(DFUNC(bi_moduleMine)); diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 9ae35a4ce4..6b66dbcc33 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -152,16 +152,6 @@ if (_activated) then { _x radiochanneladd [_player]; } foreach (_logic getvariable ["channels",[]]); - // Added by ACE_zeus to toggle ascension messages - if (GVAR(zeusAscension)) then { - //--- Sent notification to all assigned players - { - if (isplayer _x) then { - [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; - }; - } foreach (curatoreditableobjects _logic); - }; - [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; //--- Forced interface @@ -192,16 +182,6 @@ if (_activated) then { }; }; - // Added by ACE_zeus to toggle eagle - if (GVAR(zeusBird)) then { - //--- Create bird - _birdType = _logic getvariable ["birdType","eagle_f"]; - if (_birdType != "") then { - _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; - _logic setvariable ["bird",_bird,true]; - }; - }; - //--- Activated all future addons _addons = []; { @@ -217,18 +197,8 @@ if (_activated) then { } foreach (synchronizedobjects _logic); _addons call bis_fnc_activateaddons; - // Added by ACE_zeus to toggle eagle - if (GVAR(zeusBird)) then { - //--- Locality changed - _logic addeventhandler [ - "local", - { - _logic = _this select 0; - _bird = _logic getvariable ["bird",objnull]; - _bird setowner owner _logic; - } - ]; - }; + // Added by ACE_zeus to delay ascension messages and bird code (so that settings can be changed) + [{_this spawn DFUNC(moduleCuratorDelay);},[_logic,_player]] call EFUNC(common,execNextFrame); }; //--- Player diff --git a/addons/zeus/functions/fnc_moduleCuratorDelay.sqf b/addons/zeus/functions/fnc_moduleCuratorDelay.sqf index 734cf1a999..4e9f8cd769 100644 --- a/addons/zeus/functions/fnc_moduleCuratorDelay.sqf +++ b/addons/zeus/functions/fnc_moduleCuratorDelay.sqf @@ -1,12 +1,11 @@ /* * Author: SilentSpike - * Function that delays the execution of the curator module function + * Function executed at a delay to allow curator settings module to run first * Allows ascension and bird settings to be set by module beforehand * * Arguments: * 0: The module logic - * 1: units - * 2: activated + * 1: Zeus player * * Return Value: * None @@ -16,4 +15,39 @@ #include "script_component.hpp" -[{_this spawn DFUNC(bi_moduleCurator);},_this] call EFUNC(common,execNextFrame); +if (isServer) then { + private ["_logic","_player","_birdType","_bird"]; + + _logic = _this select 0; + _player = _this select 1; + + // Extracted from moduleCurator to toggle ascension messages + if (GVAR(zeusAscension)) then { + //--- Sent notification to all assigned players + { + if (isplayer _x) then { + [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; + }; + } foreach (curatoreditableobjects _logic); + }; + + // Extracted from moduleCurator to toggle eagle + if (GVAR(zeusBird)) then { + //--- Create bird + _birdType = _logic getvariable ["birdType","eagle_f"]; + if (_birdType != "") then { + _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _logic setvariable ["bird",_bird,true]; + }; + + //--- Locality changed + _logic addeventhandler [ + "local", + { + _logic = _this select 0; + _bird = _logic getvariable ["bird",objnull]; + _bird setowner owner _logic; + } + ]; + }; +};