From b288640d90d72f950ffcfe2cd413779443b666ba Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 6 Jul 2019 18:20:03 -0700 Subject: GLK: ALAN3: Another attempt at an openpandora fix --- engines/glk/alan2/alan2.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/glk') 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; } } -- cgit v1.2.3