aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-11-06 23:58:15 +0000
committerTravis Howell2006-11-06 23:58:15 +0000
commitfe33cd84d69a1a0c7cf55498895e65f5e4ba6f42 (patch)
tree768d722f62b6a88630a2e4b1965e4bc0581fb83d /engines
parentc9cb98291db28b7f2a041e2ed5e90ba5f40764a9 (diff)
downloadscummvm-rg350-fe33cd84d69a1a0c7cf55498895e65f5e4ba6f42.tar.gz
scummvm-rg350-fe33cd84d69a1a0c7cf55498895e65f5e4ba6f42.tar.bz2
scummvm-rg350-fe33cd84d69a1a0c7cf55498895e65f5e4ba6f42.zip
Fix restarting game in Elvira 1
svn-id: r24645
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/saveload.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index a0f973d844..1d2ab2690e 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -625,11 +625,11 @@ bool AGOSEngine::loadGame_e1(const char *filename) {
for (num = _itemArrayInited - 1; num; num--) {
Item *item = _itemArrayPtr[item_index++], *parent_item;
- uint16 parent = f->readUint32BE();
- if (parent == 0xFFFF)
+ uint32 parent = f->readUint32BE();
+ if (parent == 0xFFFFFFFF)
parent_item = 0;
else
- parent_item = derefItem(parent);
+ parent_item = derefItem(parent + 1);
setItemParent(item, parent_item);
@@ -657,11 +657,11 @@ bool AGOSEngine::loadGame_e1(const char *filename) {
u->userFlags[i] = f->readUint16BE();
}
- uint16 val = f->readUint32BE();
- if (val == 0xFFFF)
+ uint32 val = f->readUint32BE();
+ if (val == 0xFFFFFFFF)
u->userItems[0] = 0;
else
- u->userItems[0] = val;
+ u->userItems[0] = val + 1;
}
}
@@ -722,7 +722,7 @@ bool AGOSEngine::saveGame_e1(const char *filename) {
if (item->parent == 0)
f->writeUint32BE(0xFFFFFFFF);
else
- f->writeUint32BE(item->parent);
+ f->writeUint32BE(item->parent - 1);
f->writeUint16BE(item->state);
f->writeUint16BE(item->classFlags);
@@ -751,7 +751,7 @@ bool AGOSEngine::saveGame_e1(const char *filename) {
if (u->userItems[0] == 0)
f->writeUint32BE(0xFFFFFFFF);
else
- f->writeUint32BE(u->userItems[0]);
+ f->writeUint32BE(u->userItems[0] - 1);
}
}