From cb948934abe14058bde1dc373da8ece04fd1e904 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 21 Mar 2011 12:06:35 -0400 Subject: MOHAWK: Add workaround for loading the bytramtime variable --- engines/mohawk/riven_saveload.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index bd839646d4..d70c3c69b1 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -167,14 +167,22 @@ bool RivenSaveLoad::loadGame(Common::String filename) { uint32 *var = _vm->getVar(name); - *var = rawVariables[i]; - - if (name.equalsIgnoreCase("CurrentStackID")) + // Handle any special variables here + // WORKAROUND: bytramtime is reset here for one main reason: + // The save does not store any start point for the time, so we don't know the real time. + // Because of this, in many cases, the original would just give a 'free' Ytram upon saving + // since the time would be used in a new (improper) time frame. + // TODO: Check of the other 'time' variables require this too + if (name.equalsIgnoreCase("CurrentStackID")) // Remap to our definitions, store for later stackID = mapOldStackIDToNew(rawVariables[i]); - else if (name.equalsIgnoreCase("CurrentCardID")) + else if (name.equalsIgnoreCase("CurrentCardID")) // Store for later cardID = rawVariables[i]; else if (name.equalsIgnoreCase("ReturnStackID") && *var != 0) // if 0, the game did not use the variable yet *var = mapOldStackIDToNew(rawVariables[i]); + else if (name.equalsIgnoreCase("bytramtime")) // WORKAROUND: See above + *var = 0; + else // Otherwise, just store it + *var = rawVariables[i]; } _vm->changeToStack(stackID); -- cgit v1.2.3