[Scummvm-git-logs] scummvm master -> 7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8
dreammaster
dreammaster at scummvm.org
Sat Apr 14 21:03:21 CEST 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7b6dd298e4 XEEN: Clear prior pending treasure when loading savegame
Commit: 7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8
https://github.com/scummvm/scummvm/commit/7b6dd298e4b1afbe3d58fbe75dd686d78de15ba8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-14T15:03:15-04:00
Commit Message:
XEEN: Clear prior pending treasure when loading savegame
Changed paths:
engines/xeen/party.cpp
engines/xeen/party.h
engines/xeen/saves.cpp
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index eafc026..db73a47 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 4b0616b..3d61424 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 4aee1a6..60cac91 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();
More information about the Scummvm-git-logs
mailing list