aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/timeout2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/avalanche/timeout2.cpp')
-rw-r--r--engines/avalanche/timeout2.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 459f12415d..dba78870e9 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -57,17 +57,22 @@ Timeout::Timeout(AvalancheEngine *vm) {
}
void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
- fv = 0;
- while ((fv < 7) && (times[fv].time_left != 0))
- fv++;
-
- if (fv == 7)
- return; /* Oh dear... */
-
- /* Everything's OK here! */
- times[fv].time_left = howlong;
- times[fv].then_where = whither;
- times[fv].what_for = why;
+ if (_vm->_gyro->isLoaded == false) {
+ byte i = 0;
+ while ((i < 7) && (times[i].time_left != 0))
+ i++;
+
+ if (i == 7)
+ return; // Oh dear...
+
+ // Everything's OK here!
+ times[i].time_left = howlong;
+ times[i].then_where = whither;
+ times[i].what_for = why;
+ } else {
+ _vm->_gyro->isLoaded = false;
+ return;
+ }
}
void Timeout::one_tick() {