aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/saveload.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-11-17 10:27:31 +0000
committerTravis Howell2007-11-17 10:27:31 +0000
commitf10f40aff00e2a5758349ef246098c4c9f2ed06d (patch)
treeb0122edd1816d52b5e4a2f4e35b5b95a69e8b287 /engines/agos/saveload.cpp
parent2e3866b6f4717212a61c79b3ff368b937405336e (diff)
downloadscummvm-rg350-f10f40aff00e2a5758349ef246098c4c9f2ed06d.tar.gz
scummvm-rg350-f10f40aff00e2a5758349ef246098c4c9f2ed06d.tar.bz2
scummvm-rg350-f10f40aff00e2a5758349ef246098c4c9f2ed06d.zip
Fix bug #1759850 - ELVIRA2: Restart state file causes crash. The itemStore data needed to be adjusting, when loading or saving in the AtariST and Amiga versions.
svn-id: r29534
Diffstat (limited to 'engines/agos/saveload.cpp')
-rw-r--r--engines/agos/saveload.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index b399e58688..16dd32b97e 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -1261,7 +1261,10 @@ 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 && getPlatform() == Common::kPlatformPC) {
+ 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));
} else {
_itemStore[i] = derefItem(f->readUint16BE());
@@ -1405,7 +1408,10 @@ 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 && getPlatform() == Common::kPlatformPC) {
+ 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]));
} else {
f->writeUint16BE(itemPtrToID(_itemStore[i]));