From 70c4f25aef09d7e15d13090909cd6713cd4572e6 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 18 Nov 2007 04:02:11 +0000 Subject: Fix loading restart state file in Amiga version of Waxworks. svn-id: r29543 --- engines/agos/saveload.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'engines/agos/saveload.cpp') diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index 9df7e6815c..3ece2caecf 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -1267,11 +1267,14 @@ bool AGOSEngine_Elvira2::loadGame(const char *filename, bool restartMode) { // read the items in item store for (i = 0; i != _numItemStore; i++) { - if ((getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) && - (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST)) { - _itemStore[i] = derefItem(f->readUint16BE() / 18); - } else if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformPC) { - _itemStore[i] = derefItem(readItemID(f)); + if (getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) { + _itemStore[i] = derefItem(f->readUint16BE() / 16); + } else if (getGameType() == GType_ELVIRA2) { + if (getPlatform() == Common::kPlatformPC) { + _itemStore[i] = derefItem(readItemID(f)); + } else { + _itemStore[i] = derefItem(f->readUint16BE() / 18); + } } else { _itemStore[i] = derefItem(f->readUint16BE()); } @@ -1414,11 +1417,14 @@ bool AGOSEngine_Elvira2::saveGame(uint slot, const char *caption) { // write the items in item store for (i = 0; i != _numItemStore; i++) { - if ((getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) && - (getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformAtariST)) { - f->writeUint16BE(itemPtrToID(_itemStore[i]) * 18); - } else if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformPC) { - writeItemID(f, itemPtrToID(_itemStore[i])); + if (getGameType() == GType_WW && getPlatform() == Common::kPlatformAmiga) { + f->writeUint16BE(itemPtrToID(_itemStore[i]) * 16); + } else if (getGameType() == GType_ELVIRA2) { + if (getPlatform() == Common::kPlatformPC) { + writeItemID(f, itemPtrToID(_itemStore[i])); + } else { + f->writeUint16BE(itemPtrToID(_itemStore[i]) * 18); + } } else { f->writeUint16BE(itemPtrToID(_itemStore[i])); } -- cgit v1.2.3