diff options
author | Marisa-Chan | 2013-10-18 22:58:02 +0000 |
---|---|---|
committer | Marisa-Chan | 2013-10-18 22:58:02 +0000 |
commit | aefa58f5a4470b1ba2e275c62aa1a7a0cec76539 (patch) | |
tree | 72c3ed17dca3cbf0948fd941d273b7a35674eb7d /engines | |
parent | 4ac2c3e93bd78d4e151035fcde0dae9f17eeb11a (diff) | |
download | scummvm-rg350-aefa58f5a4470b1ba2e275c62aa1a7a0cec76539.tar.gz scummvm-rg350-aefa58f5a4470b1ba2e275c62aa1a7a0cec76539.tar.bz2 scummvm-rg350-aefa58f5a4470b1ba2e275c62aa1a7a0cec76539.zip |
ZVISION: Correcting TimerNode behavior.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/timer_node.cpp | 15 | ||||
-rw-r--r-- | engines/zvision/timer_node.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/engines/zvision/timer_node.cpp b/engines/zvision/timer_node.cpp index 7fc3199a8a..dc7dd5b38c 100644 --- a/engines/zvision/timer_node.cpp +++ b/engines/zvision/timer_node.cpp @@ -34,16 +34,25 @@ namespace ZVision { TimerNode::TimerNode(ZVision *engine, uint32 key, uint timeInSeconds) : SideFX(engine, key, SIDEFX_TIMER) { + if (_engine->getGameId() == GID_NEMESIS) _timeLeft = timeInSeconds * 1000; + else if (_engine->getGameId() == GID_GRANDINQUISITOR) + _timeLeft = timeInSeconds * 100; + _engine->getScriptManager()->setStateValue(_key, 1); +} + +TimerNode::~TimerNode() { + if (_timeLeft <= 0) + _engine->getScriptManager()->setStateValue(_key, 2); + else + _engine->getScriptManager()->setStateValue(_key, _timeLeft); // If timer was stopped by stop or kill } bool TimerNode::process(uint32 deltaTimeInMillis) { _timeLeft -= deltaTimeInMillis; - if (_timeLeft <= 0) { - _engine->getScriptManager()->setStateValue(_key, 0); + if (_timeLeft <= 0) return true; - } return false; } diff --git a/engines/zvision/timer_node.h b/engines/zvision/timer_node.h index afdbd39803..2caf43ad3c 100644 --- a/engines/zvision/timer_node.h +++ b/engines/zvision/timer_node.h @@ -32,6 +32,7 @@ class ZVision; class TimerNode : public SideFX { public: TimerNode(ZVision *engine, uint32 key, uint timeInSeconds); + ~TimerNode(); /** * Decrement the timer by the delta time. If the timer is finished, set the status |