diff options
author | Paul Gilbert | 2018-04-14 15:03:15 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-14 15:03:15 -0400 |
commit | 7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8 (patch) | |
tree | 5db967f597fced55e3b724e08ff6fe05ffd9eeaa | |
parent | a189f2c7d2f2cb207c98b7e950c0f7ef97f94eb2 (diff) | |
download | scummvm-rg350-7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8.tar.gz scummvm-rg350-7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8.tar.bz2 scummvm-rg350-7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8.zip |
XEEN: Clear prior pending treasure when loading savegame
-rw-r--r-- | engines/xeen/party.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/party.h | 5 | ||||
-rw-r--r-- | engines/xeen/saves.cpp | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index eafc026e34..db73a475bc 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -87,6 +87,12 @@ void Treasure::clear() { } } +void Treasure::reset() { + clear(); + _hasItems = false; + _gold = _gems = 0; +} + /*------------------------------------------------------------------------*/ const int BLACKSMITH_DATA1[4][4] = { diff --git a/engines/xeen/party.h b/engines/xeen/party.h index 4b0616bfc6..3d6142451c 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -87,6 +87,11 @@ public: * Clears the treasure list */ void clear(); + + /** + * Completely reset the treasure data + */ + void reset(); }; /** diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp index 4aee1a6a34..60cac91b75 100644 --- a/engines/xeen/saves.cpp +++ b/engines/xeen/saves.cpp @@ -190,6 +190,7 @@ Common::Error SavesManager::loadGameState(int slot) { // Reset any combat information from the previous game combat.reset(); + party._treasure.reset(); // Load the new map map.clearMaze(); |