aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/alan2/alan2.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp
index 9b2478fd4f..4168ca26b9 100644
--- a/engines/glk/alan2/alan2.cpp
+++ b/engines/glk/alan2/alan2.cpp
@@ -157,14 +157,15 @@ static void syncObjects(Common::Serializer &s) {
}
static void syncEventQueue(Common::Serializer &s) {
+ int i;
if (s.isSaving()) {
eventq[etop].time = 0; // Mark the top
- for (int i = 0; i <= etop; ++i)
+ for (i = 0; i <= etop; ++i)
eventq[i].synchronize(s);
} else {
- for (etop = 0; eventq[etop - 1].time; ++etop)
- eventq[etop].synchronize(s);
- --etop;
+ for (i = 0; eventq[i - 1].time; ++i)
+ eventq[i].synchronize(s);
+ etop = i - 1;
}
}