mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Run functions after setting init
This commit is contained in:
parent
c213c0e05a
commit
cbccd898ea
@ -150,6 +150,14 @@ call FUNC(checkFiles);
|
||||
//Event that settings are safe to use:
|
||||
["SettingsInitialized", []] call FUNC(localEvent);
|
||||
|
||||
//Set init finished and run all delayed functions:
|
||||
GVAR(settingsInitFinished) = true;
|
||||
diag_log text format ["%1 delayed functions", (count GVAR(runAtSettingsInitialized))];
|
||||
{
|
||||
_x params ["_args", "_code"];
|
||||
_args call _code;
|
||||
} forEach GVAR(runAtSettingsInitialized);
|
||||
|
||||
}, 0, [false]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
@ -326,7 +334,7 @@ GVAR(OldIsCamera) = false;
|
||||
if (didJip) then {
|
||||
// We are jipping! Get ready and wait, and throw the event
|
||||
[{
|
||||
if(!(isNull player)) then {
|
||||
if((!(isNull player)) && GVAR(settingsInitFinished)) then {
|
||||
["PlayerJip", [player] ] call FUNC(localEvent);
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -303,6 +303,9 @@ GVAR(nextFrameNo) = diag_frameno;
|
||||
GVAR(nextFrameBufferA) = [];
|
||||
GVAR(nextFrameBufferB) = [];
|
||||
|
||||
GVAR(settingsInitFinished) = false;
|
||||
GVAR(runAtSettingsInitialized) = [];
|
||||
|
||||
// @TODO: Generic local-managed global-synced objects (createVehicleLocal)
|
||||
|
||||
//Debug
|
||||
|
Loading…
Reference in New Issue
Block a user