aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-06 18:52:39 -0700
committerPaul Gilbert2019-07-06 18:52:39 -0700
commit8952503207f54c35640bf1f3ac4e0474bccdb719 (patch)
treebdd97067c55272648508bc248cd7864b6911ed3f
parentb288640d90d72f950ffcfe2cd413779443b666ba (diff)
downloadscummvm-rg350-8952503207f54c35640bf1f3ac4e0474bccdb719.tar.gz
scummvm-rg350-8952503207f54c35640bf1f3ac4e0474bccdb719.tar.bz2
scummvm-rg350-8952503207f54c35640bf1f3ac4e0474bccdb719.zip
GLK: ALAN3: One final attempt at an openpandora fix
-rw-r--r--engines/glk/alan2/alan2.cpp18
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);
}
}