aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/time.cpp
diff options
context:
space:
mode:
authorPeter Kohaut2019-02-11 20:57:57 +0100
committerPeter Kohaut2019-02-11 22:48:55 +0100
commit6854ea3ddd83798a9045307763bbb346d8a1736b (patch)
tree14fefc869658b53c4b2ee62b37fc04735508c13b /engines/bladerunner/time.cpp
parentb14fbaa72b3218862a533dd7f7c0e97e1bed4df7 (diff)
downloadscummvm-rg350-6854ea3ddd83798a9045307763bbb346d8a1736b.tar.gz
scummvm-rg350-6854ea3ddd83798a9045307763bbb346d8a1736b.tar.bz2
scummvm-rg350-6854ea3ddd83798a9045307763bbb346d8a1736b.zip
BLADERUNNER: Improved time management
This should fix thi issue with freezing actors after loading save game, but works on new saves only. Game was not paused before saving and wrong timer value got saved.
Diffstat (limited to 'engines/bladerunner/time.cpp')
-rw-r--r--engines/bladerunner/time.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/bladerunner/time.cpp b/engines/bladerunner/time.cpp
index 2e412824f8..5d82a0cd55 100644
--- a/engines/bladerunner/time.cpp
+++ b/engines/bladerunner/time.cpp
@@ -25,20 +25,25 @@
#include "bladerunner/bladerunner.h"
#include "common/timer.h"
+#include "common/system.h"
namespace BladeRunner {
Time::Time(BladeRunnerEngine *vm) {
_vm = vm;
- _start = _vm->getTotalPlayTime();
+ _start = currentSystem();
_pauseCount = 0;
_offset = 0;
_pauseStart = 0;
}
+int Time::currentSystem() {
+ return _vm->getTotalPlayTime();
+}
+
int Time::current() {
- int time = _vm->getTotalPlayTime() - _offset;
+ int time = currentSystem() - _offset;
return time - _start;
}