From c577f6dba40df60f48a87a1b6733abda5aa91dbb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 24 Feb 2018 16:14:59 -0500 Subject: XEEN: Don't save prior map state when loading new saves --- engines/xeen/map.cpp | 4 ++++ engines/xeen/map.h | 6 ++++++ engines/xeen/saves.cpp | 1 + 3 files changed, 11 insertions(+) diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 2200d145ef..d57d2585d7 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -1169,6 +1169,10 @@ void Map::saveMaze() { saveMonsters(); } +void Map::clearMaze() { + _mazeData[0]._mazeNumber = 0; +} + void Map::cellFlagLookup(const Common::Point &pt) { Common::Point pos = pt; findMap(); diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 1f17954bac..a0bc77a7ec 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -483,6 +483,12 @@ public: */ void saveMaze(); + /** + * Clears the current maze. This is used during savegame loads so that + * the previous games maze data isn't saved as the new map is loaded + */ + void clearMaze(); + /** * Gets the data for a map position at one of the relative indexes * surrounding the current position diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp index dbd3d8bc80..27819fda0a 100644 --- a/engines/xeen/saves.cpp +++ b/engines/xeen/saves.cpp @@ -213,6 +213,7 @@ Common::Error SavesManager::loadGameState(int slot) { files.load(*saveFile); // Load the new map + map.clearMaze(); map._loadDarkSide = files._isDarkCc; map.load(party._mazeId); -- cgit v1.2.3