Skip to content

Commit

Permalink
AGI: PREAGI: Fix MICKEY saves always loading to Earth
Browse files Browse the repository at this point in the history
Fixes loading a saved game and always returning to Earth instead of the
planet the game was saved on.

Unclear if this was original behavior, but we already save the current
planet and load it back, so it seems wrong to discard that and send the
player to a different planet instead.
  • Loading branch information
sluicebox committed Dec 13, 2024
1 parent bdf451b commit 188b068
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions engines/agi/preagi/mickey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,14 +1013,11 @@ bool MickeyEngine::loadGame() {
}

saveVersion = infile->readByte();
if (saveVersion < 2) {
warning("The planet data in this save game is corrupted. Load aborted");
if (saveVersion != MSA_SAVEGAME_VERSION) { // currently only one valid version
warning("MickeyEngine::loadGame unknown save version: %d", saveVersion);
return false;
}

if (saveVersion != MSA_SAVEGAME_VERSION)
warning("Old save game version (%d, current version is %d). Will try and read anyway, but don't be surprised if bad things happen", saveVersion, MSA_SAVEGAME_VERSION);

_gameStateMickey.iRoom = infile->readByte();
_gameStateMickey.iPlanet = infile->readByte();
_gameStateMickey.iDisk = infile->readByte();
Expand Down Expand Up @@ -1426,9 +1423,7 @@ void MickeyEngine::intro() {
_gameStateMickey.fIntro = true;
if (chooseY_N(IDO_MSA_LOAD_GAME[0], true)) {
if (loadGame()) {
_gameStateMickey.iPlanet = IDI_MSA_PLANET_EARTH;
_gameStateMickey.fIntro = false;
_gameStateMickey.iRoom = IDI_MSA_PIC_SHIP_CORRIDOR;
return;
}
}
Expand Down

0 comments on commit 188b068

Please sign in to comment.