aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/saves.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-29 21:45:16 -0400
committerPaul Gilbert2018-04-29 21:45:16 -0400
commitb099b5504d3d9c16af67463d250dd71163950bf9 (patch)
tree22d7230af224ac697ae3eba0c86500187d69c197 /engines/xeen/saves.cpp
parent87e5f60ceaa51a91d1bc23583b58c4642a6bf87f (diff)
downloadscummvm-rg350-b099b5504d3d9c16af67463d250dd71163950bf9.tar.gz
scummvm-rg350-b099b5504d3d9c16af67463d250dd71163950bf9.tar.bz2
scummvm-rg350-b099b5504d3d9c16af67463d250dd71163950bf9.zip
XEEN: Support importing Clouds/Darkside savegames to World of Xeen
Diffstat (limited to 'engines/xeen/saves.cpp')
-rw-r--r--engines/xeen/saves.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/xeen/saves.cpp b/engines/xeen/saves.cpp
index 60cac91b75..96490c8937 100644
--- a/engines/xeen/saves.cpp
+++ b/engines/xeen/saves.cpp
@@ -177,9 +177,13 @@ Common::Error SavesManager::loadGameState(int slot) {
uint fileSize = saveFile->readUint32LE();
if (archives[idx]) {
- Common::SeekableSubReadStream arcStream(saveFile, saveFile->pos(),
- saveFile->pos() + fileSize);
- archives[idx]->load(arcStream);
+ if (fileSize) {
+ Common::SeekableSubReadStream arcStream(saveFile, saveFile->pos(),
+ saveFile->pos() + fileSize);
+ archives[idx]->load(arcStream);
+ } else {
+ archives[idx]->reset((idx == 1) ? File::_darkCc : File::_xeenCc);
+ }
} else {
assert(!fileSize);
}
@@ -188,6 +192,9 @@ Common::Error SavesManager::loadGameState(int slot) {
// Read in miscellaneous
files.load(*saveFile);
+ // Load the character roster and party
+ File::_currentSave->loadParty();
+
// Reset any combat information from the previous game
combat.reset();
party._treasure.reset();
@@ -228,6 +235,9 @@ void SavesManager::newGame() {
File::_darkSave : File::_xeenSave;
assert(File::_currentSave);
+ // Load the character roster and party
+ File::_currentSave->loadParty();
+
// Set any final initial values
Party &party = *g_vm->_party;
party.resetBlacksmithWares();