Merge pull request #1233 from SilentSpike/zeusFix

Another fix for moduleCurator
This commit is contained in:
Nicolás Badano 2015-05-15 17:19:05 -03:00
commit ab6568c5b9
3 changed files with 38 additions and 56 deletions

View File

@ -6,7 +6,6 @@ PREP(bi_moduleCurator);
PREP(bi_moduleMine);
PREP(bi_moduleProjectile);
PREP(bi_moduleRemoteControl);
PREP(moduleCuratorDelay);
PREP(moduleZeusSettings);
ADDON = true;

View File

@ -152,6 +152,21 @@ if (_activated) then {
_x radiochanneladd [_player];
} foreach (_logic getvariable ["channels",[]]);
// Added by ACE_zeus to delay ascension message at mission start
[{
_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;
//--- Forced interface
@ -197,8 +212,29 @@ if (_activated) then {
} foreach (synchronizedobjects _logic);
_addons call bis_fnc_activateaddons;
// 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);
// Added by ACE_zeus to delay bird code
[{
_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

View File

@ -1,53 +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 <LOGIC>
* 1: Zeus player <OBJECT>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
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;
}
];
};
};