mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Remove the "ServerSettingsReceived" event, which is not longer needed. As per @pabstmirror solution, the GVAR(Settings) variable is monitored to determine when the server info has arrived. Fix #1273
This commit is contained in:
parent
5efde25585
commit
afa6a2fad9
@ -254,6 +254,7 @@ GVAR(commonPostInited) = true;
|
||||
[{
|
||||
// If post inits are not ready then wait
|
||||
if !(SLX_XEH_MACHINE select 8) exitWith {};
|
||||
|
||||
// If settings are not initialized then wait
|
||||
if (isNil QGVAR(settings)) exitWith {
|
||||
diag_log text format["[ACE] Waiting on settings from server"];
|
||||
@ -261,11 +262,16 @@ GVAR(commonPostInited) = true;
|
||||
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
diag_log text format["[ACE] Settings received from server"];
|
||||
|
||||
// Load user settings from profile
|
||||
if (hasInterface) then {
|
||||
call FUNC(loadSettingsFromProfile);
|
||||
call FUNC(loadSettingsLocalizedText);
|
||||
};
|
||||
|
||||
diag_log text format["[ACE] Settings initialized"];
|
||||
|
||||
//Load from profile and localize settings:
|
||||
["ServerSettingsReceived", []] call FUNC(localEvent);
|
||||
|
||||
|
||||
//Event that settings are safe to use:
|
||||
["SettingsInitialized", []] call FUNC(localEvent);
|
||||
|
||||
|
@ -294,23 +294,9 @@ GVAR(waitAndExecArray) = [];
|
||||
//Debug
|
||||
ACE_COUNTERS = [];
|
||||
|
||||
// Wait for server settings to arrive
|
||||
GVAR(SettingsInitialized) = false;
|
||||
["ServerSettingsReceived", {
|
||||
diag_log text format["[ACE] Settings received from server"];
|
||||
// Load user settings from profile
|
||||
if (hasInterface) then {
|
||||
call FUNC(loadSettingsFromProfile);
|
||||
call FUNC(loadSettingsLocalizedText);
|
||||
};
|
||||
GVAR(SettingsInitialized) = true;
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
// Load settings on the server and broadcast them
|
||||
if (isServer) then {
|
||||
call FUNC(loadSettingsOnServer);
|
||||
// Raise a local event for other modules to listen too
|
||||
["ServerSettingsReceived", []] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
ACE_player = player;
|
||||
|
Loading…
Reference in New Issue
Block a user