From 5e257a500b982c77d617f2103e504d72d489697b Mon Sep 17 00:00:00 2001 From: uruk Date: Thu, 25 Jul 2013 22:54:28 +0200 Subject: AVALANCHE: Implement Timeout::one_tick(). --- engines/avalanche/avalot.cpp | 2 +- engines/avalanche/timeout2.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'engines/avalanche') diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 4674ceacaa..408da93bea 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -197,7 +197,7 @@ void Avalot::run(Common::String arg) { if (_vm->_gyro->visible == _vm->_gyro->m_virtual) _vm->_gyro->wipe_vmc(_vm->_gyro->cp); - //_vm->_timeout->one_tick(); + _vm->_timeout->one_tick(); diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index 647cfe4b46..88277ef2f6 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -74,13 +74,12 @@ void Timeout::one_tick() { if (_vm->_gyro->ddmnow) return; - for (fv = 1; fv <= 7; fv++) { - timetype &with = times[fv]; - if (with.time_left > 0) { - with.time_left -= 1; + for (fv = 0; fv < 7; fv++) { + if (times[fv].time_left > 0) { + times[fv].time_left --; - if (with.time_left == 0) { - switch (with.then_where) { + if (times[fv].time_left == 0) { + switch (times[fv].then_where) { case procopen_drawbridge : open_drawbridge(); break; @@ -208,8 +207,8 @@ void Timeout::one_tick() { } } } - _vm->_gyro->roomtime += 1; /* Cycles since you've been in this room. */ - _vm->_gyro->dna.total_time += 1; /* Total amount of time for this game. */ + _vm->_gyro->roomtime++; /* Cycles since you've been in this room. */ + _vm->_gyro->dna.total_time++; /* Total amount of time for this game. */ } void Timeout::lose_timer(byte which) { -- cgit v1.2.3