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;
|
2015-05-10 14:50:58 +00:00
|
|
|
ACE_diagTime = diag_tickTime;
|
2015-05-10 05:53:20 +00:00
|
|
|
|
2015-05-10 14:50:58 +00:00
|
|
|
_delta = ACE_diagTime - _lastRealTime;
|
2015-05-10 06:13:02 +00:00
|
|
|
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
|
2015-05-10 14:42:53 +00:00
|
|
|
ACE_realTime = ACE_realTime + _delta;
|
2015-05-10 06:09:33 +00:00
|
|
|
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
|
2015-05-10 14:42:53 +00:00
|
|
|
ACE_time = ACE_virtualTime;
|
2015-05-10 05:53:20 +00:00
|
|
|
};
|
|
|
|
|