From 994e6f91e139c5104c5a11ccca6de45c5504ec65 Mon Sep 17 00:00:00 2001 From: He-Man Date: Sun, 10 Dec 2017 18:25:16 +0100 Subject: [PATCH] Fixes for ForceUpdate --- Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf | 4 +++- Sources/epoch_code/gui/scripts/Epoch_onPause.sqf | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf b/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf index 275d195e..fc71d57e 100644 --- a/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf +++ b/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf @@ -66,6 +66,7 @@ if !(alive player && alive _playerObject && !isPlayer _playerObject) then { waituntil {local _playerObject}; // restart masterloop + EPOCH_forceUpdateNow = nil; // Set to nil and wait later until Masterloop has redefined it [] spawn EPOCH_masterLoop; [5, 100] call EPOCH_niteLight; @@ -76,9 +77,10 @@ if !(alive player && alive _playerObject && !isPlayer _playerObject) then { player removeEventHandler [_x, 0]; player addEventHandler [_x,(["CfgEpochClient", _x, ""] call EPOCH_fnc_returnConfigEntryV2)]; } forEach (["CfgEpochClient", "addEventHandler", []] call EPOCH_fnc_returnConfigEntryV2); + waituntil {uisleep 0.5; !isnil "EPOCH_forceUpdateNow"}; // Wait until Materloop is has set this Variable to false + EPOCH_forceUpdateNow = true; }; } else { deleteVehicle _playerObject; }; -EPOCH_forceUpdateNow = true; diff --git a/Sources/epoch_code/gui/scripts/Epoch_onPause.sqf b/Sources/epoch_code/gui/scripts/Epoch_onPause.sqf index e7c19fdd..760f7454 100644 --- a/Sources/epoch_code/gui/scripts/Epoch_onPause.sqf +++ b/Sources/epoch_code/gui/scripts/Epoch_onPause.sqf @@ -68,14 +68,13 @@ _respawnButton ctrlEnable false; [_display] spawn { disableSerialization; params ["_display"]; - EPOCH_forceUpdate = true; _startTime = diag_tickTime+5; waitUntil { uiSleep 0.2; (isNull _display) || ((_startTime - diag_tickTime) <= 0) }; if (!isNull _display) then { - EPOCH_forceUpdate = true; + missionnamespace setvariable ["EPOCH_forceUpdateNow",true]; }; };