2015-09-19 22:55:58 +00:00
|
|
|
/*
|
|
|
|
* Author: ?
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Public: ?
|
|
|
|
*/
|
2015-05-10 05:53:20 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-19 22:55:58 +00:00
|
|
|
private ["_lastTickTime", "_lastGameTime", "_delta"];
|
2015-05-10 05:53:20 +00:00
|
|
|
|
2015-05-22 19:29:56 +00:00
|
|
|
_lastTickTime = ACE_diagTime;
|
2015-05-10 05:53:20 +00:00
|
|
|
_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-22 19:29:56 +00:00
|
|
|
_delta = ACE_diagTime - _lastTickTime;
|
2015-09-20 13:52:40 +00:00
|
|
|
|
2015-09-19 22:55:58 +00:00
|
|
|
if (ACE_gameTime <= _lastGameTime) then {
|
2015-05-22 19:29:56 +00:00
|
|
|
TRACE_1("paused",_delta);
|
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-22 19:29:56 +00:00
|
|
|
TRACE_1("live",_delta);
|
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
|
|
|
};
|