diff options
author | Max Horn | 2003-05-30 00:40:58 +0000 |
---|---|---|
committer | Max Horn | 2003-05-30 00:40:58 +0000 |
commit | 5557ec719eb20de718edff582fe4861c28b683ae (patch) | |
tree | 8d6f4be7e61571c1922dc6a67c23bfc0fe617c39 | |
parent | 864fbb1d9978d21b41f393e2a7b8afb536d0caed (diff) | |
download | scummvm-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.cpp | 8 |
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); |