From 38abe1dd02610fae5f3303b1e737ab4293abdf99 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Fri, 15 May 2015 21:09:55 +0100 Subject: [PATCH] Using inline code instead of holdover function --- addons/zeus/XEH_preInit.sqf | 1 - .../zeus/functions/fnc_bi_moduleCurator.sqf | 37 +++++++++++- .../zeus/functions/fnc_moduleCuratorDelay.sqf | 58 ------------------- 3 files changed, 35 insertions(+), 61 deletions(-) delete mode 100644 addons/zeus/functions/fnc_moduleCuratorDelay.sqf diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 5841245e65..e7bb1b96a5 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -6,7 +6,6 @@ PREP(bi_moduleCurator); PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); -PREP(moduleCuratorDelay); PREP(moduleZeusSettings); ADDON = true; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 05b6923dd1..c254358f4b 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -153,7 +153,19 @@ if (_activated) then { } foreach (_logic getvariable ["channels",[]]); // Added by ACE_zeus to delay ascension message at mission start - [DFUNC(moduleCuratorDelay),[_logic,1]] call EFUNC(common,execNextFrame); + [{ + _logic = _this select 0; + _player = _this select 1; + + 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,_player]] call EFUNC(common,execNextFrame); [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; @@ -201,7 +213,28 @@ if (_activated) then { _addons call bis_fnc_activateaddons; // Added by ACE_zeus to delay bird code - [DFUNC(moduleCuratorDelay),[_logic,0]] call EFUNC(common,execNextFrame); + [{ + _logic = _this select 0; + + 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; + } + ]; + }; + },[_logic]] call EFUNC(common,execNextFrame); }; //--- Player diff --git a/addons/zeus/functions/fnc_moduleCuratorDelay.sqf b/addons/zeus/functions/fnc_moduleCuratorDelay.sqf deleted file mode 100644 index a81cfd74a6..0000000000 --- a/addons/zeus/functions/fnc_moduleCuratorDelay.sqf +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Author: SilentSpike - * 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: Mode - * 0 - Spawn bird - * 1 - Ascension message - * - * Return Value: - * None - * - * Public: No - */ - -#include "script_component.hpp" - -if (isServer) then { - private ["_logic","_mode","_player","_birdType","_bird"]; - - _logic = _this select 0; - _mode = _this select 1; - - if (_mode == 1) then { - // Extracted from moduleCurator to toggle ascension messages - _player = getAssignedCuratorUnit _logic; - 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); - }; - } else { - // 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; - } - ]; - }; - }; -};