aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2020-01-07 22:09:25 -0800
committerPaul Gilbert2020-01-07 22:09:25 -0800
commit0bae2992577d52dd7c90f5aa5a48a0a39c52ef1e (patch)
tree72475bdd96c7da43df6bd4260a8747c2263a783e /engines/xeen
parent7d4045f4a9c5df7017de4d6bb5cd0871109b0a61 (diff)
downloadscummvm-rg350-0bae2992577d52dd7c90f5aa5a48a0a39c52ef1e.tar.gz
scummvm-rg350-0bae2992577d52dd7c90f5aa5a48a0a39c52ef1e.tar.bz2
scummvm-rg350-0bae2992577d52dd7c90f5aa5a48a0a39c52ef1e.zip
XEEN: Fix crash in WOXCD Deep Mine Alpha
Diffstat (limited to 'engines/xeen')
-rw-r--r--engines/xeen/map.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 9fd967b89b..22a85365df 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -785,17 +785,22 @@ void Map::load(int mapId) {
}
} else if (File::exists(mobName)) {
// For surrounding maps, set up flags for whether objects are present
- // Load the monster/object data
- File mobFile(mobName);
- XeenSerializer sMob(&mobFile, nullptr);
- MonsterObjectData mobData(_vm);
- mobData.synchronize(sMob, _monsterData);
- mobFile.close();
- mazeDataP->_objectsPresent.resize(mobData._objects.size());
- for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) {
- const Common::Point &pt = mobData._objects[objIndex]._position;
- mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128;
+ // WORKAROUND: In WOX CD Map 120, one of the maps for Deep Mine Alpha,
+ // has invalid monster data. So to work around it, we just ignore it
+ if (!(mapId == 120 && g_vm->getIsCD() && g_vm->getGameID() == GType_WorldOfXeen)) {
+ // Load the monster/object data
+ File mobFile(mobName);
+ XeenSerializer sMob(&mobFile, nullptr);
+ MonsterObjectData mobData(_vm);
+ mobData.synchronize(sMob, _monsterData);
+ mobFile.close();
+
+ mazeDataP->_objectsPresent.resize(mobData._objects.size());
+ for (uint objIndex = 0; objIndex < mobData._objects.size(); ++objIndex) {
+ const Common::Point &pt = mobData._objects[objIndex]._position;
+ mazeDataP->_objectsPresent[objIndex] = ABS(pt.x) != 128 && ABS(pt.y) != 128;
+ }
}
}
}