ACE3/addons/common/functions/fnc_timePFH.sqf

26 lines
697 B
Plaintext
Raw Normal View History

2015-05-10 05:53:20 +00:00
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
2015-05-14 22:17:41 +00:00
private["_lastRealTime", "_lastGameTime", "_delta"];
2015-05-10 05:53:20 +00:00
_lastRealTime = ACE_realTime;
_lastGameTime = ACE_gameTime;
ACE_gameTime = time;
ACE_diagTime = diag_tickTime;
2015-05-10 05:53:20 +00:00
_delta = ACE_diagTime - _lastRealTime;
if(ACE_gameTime <= _lastGameTime) then {
2015-05-10 06:09:33 +00:00
ACE_paused = true;
2015-05-10 05:53:20 +00:00
// Game is paused or not running
ACE_pausedTime = ACE_pausedTime + _delta;
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
} else {
2015-05-10 06:09:33 +00:00
ACE_paused = false;
2015-05-10 05:53:20 +00:00
// Time is updating
ACE_realTime = ACE_realTime + _delta;
2015-05-10 06:09:33 +00:00
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
ACE_time = ACE_virtualTime;
2015-05-10 05:53:20 +00:00
};