MOHAWK: Add workaround for loading the bytramtime variable

This commit is contained in:
Matthew Hoops 2011-03-21 12:06:35 -04:00
parent 54ac6ade49
commit cb948934ab

View file

@ -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);