diff options
| -rw-r--r-- | engines/glk/alan2/alan2.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp index 4168ca26b9..76904fb23b 100644 --- a/engines/glk/alan2/alan2.cpp +++ b/engines/glk/alan2/alan2.cpp @@ -158,14 +158,18 @@ 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 (i = 0; i <= etop; ++i) - eventq[i].synchronize(s); - } else { - for (i = 0; eventq[i - 1].time; ++i) - eventq[i].synchronize(s); + EvtqElem *arr = eventq; + + if (s.isLoading()) { + for (i = 0; arr[i - 1].time; ++i) + arr[i].synchronize(s); etop = i - 1; + } else { + // Mark the top + arr[etop].time = 0; + + for (i = 0; i <= etop; ++i) + arr[i].synchronize(s); } } |
