aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-30 00:40:58 +0000
committerMax Horn2003-05-30 00:40:58 +0000
commit5557ec719eb20de718edff582fe4861c28b683ae (patch)
tree8d6f4be7e61571c1922dc6a67c23bfc0fe617c39
parent864fbb1d9978d21b41f393e2a7b8afb536d0caed (diff)
downloadscummvm-rg350-5557ec719eb20de718edff582fe4861c28b683ae.tar.gz
scummvm-rg350-5557ec719eb20de718edff582fe4861c28b683ae.tar.bz2
scummvm-rg350-5557ec719eb20de718edff582fe4861c28b683ae.zip
work around nexus crash (only in old savegames?)
svn-id: r8123
-rw-r--r--scumm/object.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 777f79ed79..0b7021e84c 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -205,7 +205,13 @@ void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) {
ptr = getResourceAddress(rtRoom, _roomResource);
ptr += od->OBIMoffset;
}
- assert(ptr);
+ if (!ptr) {
+ // FIXME: We used to assert here, but it seems that in the nexus
+ // in The Dig, this can happen, at least with old savegames, and
+ // it's safe to continue...
+ warning("getObjectXYPos: Can't find object %d", object);
+ return;
+ }
imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), ptr);
if (_features & GF_AFTER_V8) {
x = od->x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x);