diff options
author | Kirben | 2015-05-20 11:48:31 +1000 |
---|---|---|
committer | Kirben | 2015-05-20 11:48:31 +1000 |
commit | 4a13462db2401c9f90e2bc1675162aeff147662f (patch) | |
tree | 706680bbc5e554b471ee49044c487bb01cd8f10f | |
parent | ed698701d76f055b035f4b7fef0ed0d88d0374da (diff) | |
download | scummvm-rg350-4a13462db2401c9f90e2bc1675162aeff147662f.tar.gz scummvm-rg350-4a13462db2401c9f90e2bc1675162aeff147662f.tar.bz2 scummvm-rg350-4a13462db2401c9f90e2bc1675162aeff147662f.zip |
AGOS: Fix regression when loading saved games in PC version of Waxworks.
-rw-r--r-- | engines/agos/saveload.cpp | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index 06ab60276d..5c54e4874b 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -1201,6 +1201,7 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo char ident[100]; Common::SeekableReadStream *f = NULL; uint num, item_index, i, j; + uint16 room = _currentRoom; _videoLockOut |= 0x100; @@ -1259,50 +1260,7 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo } f->readUint16BE(); - uint16 room = _currentRoom; _currentRoom = f->readUint16BE(); - - if (_roomsListPtr) { - byte *p = _roomsListPtr; - if (room == _currentRoom) { - for (;;) { - uint16 minNum = READ_BE_UINT16(p); p += 2; - if (minNum == 0) - break; - - uint16 maxNum = READ_BE_UINT16(p); p += 2; - - for (uint16 z = minNum; z <= maxNum; z++) { - uint16 itemNum = z + 2; - Item *item = derefItem(itemNum); - - num = (itemNum - _itemArrayInited); - item->state = _roomStates[num].state; - item->classFlags = _roomStates[num].classFlags; - SubRoom *subRoom = (SubRoom *)findChildOfType(item, kRoomType); - subRoom->roomExitStates = _roomStates[num].roomExitStates; - } - } - } else { - for (;;) { - uint16 minNum = READ_BE_UINT16(p); p += 2; - if (minNum == 0) - break; - - uint16 maxNum = READ_BE_UINT16(p); p += 2; - - for (uint16 z = minNum; z <= maxNum; z++) { - uint16 itemNum = z + 2; - _itemArrayPtr[itemNum] = 0; - } - } - } - } - - if (room != _currentRoom) { - _roomsListPtr = 0; - loadRoomItems(_currentRoom); - } } item_index = 1; @@ -1361,6 +1319,49 @@ bool AGOSEngine_Elvira2::loadGame(const Common::String &filename, bool restartMo } } + if (getGameType() == GType_WW && getPlatform() == Common::kPlatformDOS) { + if (_roomsListPtr) { + byte *p = _roomsListPtr; + if (room == _currentRoom) { + for (;;) { + uint16 minNum = READ_BE_UINT16(p); p += 2; + if (minNum == 0) + break; + + uint16 maxNum = READ_BE_UINT16(p); p += 2; + + for (uint16 z = minNum; z <= maxNum; z++) { + uint16 itemNum = z + 2; + Item *item = derefItem(itemNum); + + num = (itemNum - _itemArrayInited); + item->state = _roomStates[num].state; + item->classFlags = _roomStates[num].classFlags; + SubRoom *subRoom = (SubRoom *)findChildOfType(item, kRoomType); + subRoom->roomExitStates = _roomStates[num].roomExitStates; + } + } + } else { + for (;;) { + uint16 minNum = READ_BE_UINT16(p); p += 2; + if (minNum == 0) + break; + + uint16 maxNum = READ_BE_UINT16(p); p += 2; + + for (uint16 z = minNum; z <= maxNum; z++) { + uint16 itemNum = z + 2; + _itemArrayPtr[itemNum] = 0; + } + } + } + } + + if (room != _currentRoom) { + _roomsListPtr = 0; + loadRoomItems(_currentRoom); + } + } // read the variables for (i = 0; i != _numVars; i++) { writeVariable(i, f->readUint16BE()); |