mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Fix survival time not counted after clothes change
Vanilla commits:cf4fde633574dd04616f
This commit is contained in:
@@ -21,7 +21,7 @@ _1 = name player;
|
|||||||
dayz_currentGlobalZombies = count entities "zZombie_Base";
|
dayz_currentGlobalZombies = count entities "zZombie_Base";
|
||||||
|
|
||||||
//Work out survival time
|
//Work out survival time
|
||||||
_currentTime = floor (dayz_sessionTime / 60);
|
_currentTime = floor ((diag_tickTime - dayz_loginTime) / 60);
|
||||||
_totalMins = (player getVariable "SurvivalTime") + _currentTime;
|
_totalMins = (player getVariable "SurvivalTime") + _currentTime;
|
||||||
_days = floor (_totalMins / 1440);
|
_days = floor (_totalMins / 1440);
|
||||||
_totalMins = (_totalMins - (_days * 1440));
|
_totalMins = (_totalMins - (_days * 1440));
|
||||||
|
|||||||
@@ -660,7 +660,6 @@ if (!isDedicated) then {
|
|||||||
Dayz_freefall = [ time, 0, 0.1 ];
|
Dayz_freefall = [ time, 0, 0.1 ];
|
||||||
dayz_getoutTime = 0;
|
dayz_getoutTime = 0;
|
||||||
dayz_hitByTime = 0;
|
dayz_hitByTime = 0;
|
||||||
dayz_sessionTime = 0; //Approximate time elapsed since login in seconds
|
|
||||||
skipGearSound = false;
|
skipGearSound = false;
|
||||||
TimeOutDisplayed = false;
|
TimeOutDisplayed = false;
|
||||||
voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];
|
voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];
|
||||||
|
|||||||
@@ -862,6 +862,7 @@ class FSM
|
|||||||
"dayz_lastDrink = (_lastDrank * 60);" \n
|
"dayz_lastDrink = (_lastDrank * 60);" \n
|
||||||
"dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n
|
"dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n
|
||||||
"dayz_Survived = [_days,_hours,_mins,(_survival select 3)]; //total alive dayz" \n
|
"dayz_Survived = [_days,_hours,_mins,(_survival select 3)]; //total alive dayz" \n
|
||||||
|
"dayz_loginTime = diag_tickTime;" \n
|
||||||
"" \n
|
"" \n
|
||||||
"//load in medical details" \n
|
"//load in medical details" \n
|
||||||
"r_player_dead = player getVariable[""USEC_isDead"",false];" \n
|
"r_player_dead = player getVariable[""USEC_isDead"",false];" \n
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ sched_medical = { // 1 second
|
|||||||
[] spawn fnc_usec_playerHandleBlood;
|
[] spawn fnc_usec_playerHandleBlood;
|
||||||
};
|
};
|
||||||
|
|
||||||
dayz_sessionTime = dayz_sessionTime + 1;
|
|
||||||
|
|
||||||
[_unconHdlr]
|
[_unconHdlr]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ if (dayz_townGenerator) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//record time started
|
//record time started
|
||||||
_playerObj setVariable ["lastTime",time];
|
_playerObj setVariable ["lastTime",diag_ticktime];
|
||||||
|
|
||||||
//set server-side inventory variable to monitor player gear
|
//set server-side inventory variable to monitor player gear
|
||||||
if (count _inventory > 2) then {
|
if (count _inventory > 2) then {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ _bankCoins = _character getVariable [Z_BankVariable, -1];
|
|||||||
_coins = _character getVariable [Z_MoneyVariable, -1]; //should getting coins fail set the variable to an invalid value to prevent overwritting the in the DB
|
_coins = _character getVariable [Z_MoneyVariable, -1]; //should getting coins fail set the variable to an invalid value to prevent overwritting the in the DB
|
||||||
_lastPos = _character getVariable ["lastPos",_charPos];
|
_lastPos = _character getVariable ["lastPos",_charPos];
|
||||||
_usec_Dead = _character getVariable ["USEC_isDead",false];
|
_usec_Dead = _character getVariable ["USEC_isDead",false];
|
||||||
_lastTime = _character getVariable ["lastTime",diag_ticktime];
|
_lastTime = _character getVariable ["lastTime",-1];
|
||||||
_modelChk = _character getVariable ["model_CHK",""];
|
_modelChk = _character getVariable ["model_CHK",""];
|
||||||
_temp = round (_character getVariable ["temperature",100]);
|
_temp = round (_character getVariable ["temperature",100]);
|
||||||
_lastMagazines = _character getVariable ["ServerMagArray",[[],""]];
|
_lastMagazines = _character getVariable ["ServerMagArray",[[],""]];
|
||||||
@@ -117,9 +117,17 @@ if (!_usec_Dead) then {
|
|||||||
_character setVariable ["medForceUpdate",false,true];
|
_character setVariable ["medForceUpdate",false,true];
|
||||||
|
|
||||||
_character addScore _kills;
|
_character addScore _kills;
|
||||||
_timeGross = (diag_ticktime - _lastTime);
|
/*
|
||||||
_timeSince = floor (_timeGross / 60);
|
Assess how much time has passed, for recording total time on server
|
||||||
_timeLeft = (_timeGross - (_timeSince * 60));
|
Note "lastTime" is -1 after clothes change
|
||||||
|
*/
|
||||||
|
if (_lastTime == -1) then {
|
||||||
|
_character setVariable ["lastTime",diag_tickTime,false];
|
||||||
|
} else {
|
||||||
|
_timeGross = (diag_tickTime - _lastTime);
|
||||||
|
_timeSince = floor (_timeGross / 60);
|
||||||
|
_timeLeft = (_timeGross - (_timeSince * 60));
|
||||||
|
};
|
||||||
/*
|
/*
|
||||||
Get character state details
|
Get character state details
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user