diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index 3656f209..ae0355d2 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -272,6 +272,7 @@ if !(EPOCH_ActiveTraderMission isequalto []) then { // Update read only vars EPOCH_playerRadiation = _playerRadiation; +EPOCH_playerAliveTime = _playerAliveTime; // force update if (EPOCH_forceUpdateNow) then { diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf index b35470fe..457e7988 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf @@ -178,7 +178,7 @@ EPOCH_playerThirst = (EPOCH_playerThirst - _thirstlossRate) max 0; call _lootBubble; -EPOCH_playerStaminaMax = (100 * (round(EPOCH_playerAliveTime/360)/10)) min 2500; +EPOCH_playerStaminaMax = (100 * (round(_playerAliveTime/360)/10)) min 2500; // downtick Nuisance (EPOCH_customVarLimits select (EPOCH_customVars find "Nuisance")) params [["_playerLimitMax",100],["_playerLimitMin",0]]; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event5.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event5.sqf index 73e99317..54380c11 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event5.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event5.sqf @@ -86,7 +86,7 @@ if !(_powerSources isEqualTo[]) then { // downtick Alcohol EPOCH_playerAlcohol = ((EPOCH_playerAlcohol - 1) min 100) max 0; -EPOCH_playerAliveTime = round(EPOCH_playerAliveTime + (_tickTime - EPOCH_clientAliveTimer)); +_playerAliveTime = round(_playerAliveTime + (_tickTime - EPOCH_clientAliveTimer)); EPOCH_clientAliveTimer = _tickTime; // force update after 60 seconds diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index fd64fb97..7ba5e4a9 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -9,6 +9,7 @@ EPOCH_forceUpdateNow = false; // init local player stat vars _playerRadiation = EPOCH_playerRadiation; +_playerAliveTime = EPOCH_playerAliveTime; // inline function to sync player stats to server _fnc_forceUpdate = { @@ -19,12 +20,15 @@ _fnc_forceUpdate = { case ("Radiation"): { _customVars pushBack _playerRadiation; }; + case ("AliveTime"):{ + _customVars pushBack _playerAliveTime; + }; default { _customVars pushBack (missionNamespace getVariable format["EPOCH_player%1",_x]); }; }; - } forEach (missionNamespace getVariable["EPOCH_customVars", []]); - [player,_customVars,missionNamespace getVariable "Epoch_personalToken"] remoteExec ["EPOCH_fnc_savePlayer",2]; + } forEach EPOCH_customVars; + [player,_customVars,Epoch_personalToken] remoteExec ["EPOCH_fnc_savePlayer",2]; }; // disable fuel sources client side. @@ -112,13 +116,6 @@ _antagonistSpawnLimits = ["CfgEpochClient", "antagonistSpawnIndex", _antagonistS EPOCH_spawnIndex = _spawnIndex; EPOCH_spawnLimits = _spawnLimits; -// -_customVars = []; -{ - _customVars pushBack (missionNamespace getVariable format["EPOCH_player%1",_x]); -} forEach (missionNamespace getVariable["EPOCH_customVars", []]); -_prevCustomVars = _customVars; - // default data if mismatch if !(EPOCH_playerSpawnArray isEqualTypeParams _spawnIndex) then{ EPOCH_playerSpawnArray = [];