From e52f2643fd4e0e9400bbf92fd6e169dc49d485bf Mon Sep 17 00:00:00 2001 From: neuromancer Date: Thu, 28 Mar 2024 11:28:25 +0100 Subject: [PATCH] FREESCAPE: fixed bug when loading a game state in eclipse --- engines/freescape/games/driller/driller.cpp | 6 +++++- engines/freescape/games/eclipse/eclipse.cpp | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/engines/freescape/games/driller/driller.cpp b/engines/freescape/games/driller/driller.cpp index ca1ba536975..d0fd53e4fe6 100644 --- a/engines/freescape/games/driller/driller.cpp +++ b/engines/freescape/games/driller/driller.cpp @@ -161,7 +161,11 @@ void DrillerEngine::gotoArea(uint16 areaID, int entranceID) { error("Invalid movement across areas"); assert(newPos != -1); _sensors = _currentArea->getSensors(); - } + } else if (entranceID == -1) + debugC(1, kFreescapeDebugMove, "Loading game, no change in position"); + else + error("Invalid area change!"); + _lastPosition = _position; _gameStateVars[0x1f] = 0; diff --git a/engines/freescape/games/eclipse/eclipse.cpp b/engines/freescape/games/eclipse/eclipse.cpp index f9d7fb85172..fcb28d43bdd 100644 --- a/engines/freescape/games/eclipse/eclipse.cpp +++ b/engines/freescape/games/eclipse/eclipse.cpp @@ -156,11 +156,12 @@ void EclipseEngine::gotoArea(uint16 areaID, int entranceID) { _currentAreaMessages.clear(); _currentAreaMessages.push_back(_currentArea->_name); - if (entranceID == -1) - return; - - assert(entranceID > 0); - traverseEntrance(entranceID); + if (entranceID > 0) + traverseEntrance(entranceID); + else if (entranceID == -1) + debugC(1, kFreescapeDebugMove, "Loading game, no change in position"); + else + error("Invalid area change!"); _lastPosition = _position;