SAGA: When trying to access a wrong hitzone, adjust it to a valid one and continue with a warning instead of exiting with an error . We don't normally get invalid hitzones in ITE, but we do in IHNM, so this is used for now to bypass the places where IHNM crashes. It's now possible to climb the steps to the second floor of the zeppelin with Gorrister

svn-id: r27072
This commit is contained in:
Filippos Karapetis 2007-06-03 22:00:18 +00:00
parent 83c5c2ae4e
commit f6b8c98c13

View File

@ -110,7 +110,12 @@ public:
int hitTest(const Point& testPoint);
HitZone *getHitZone(int16 index) {
if ((index < 0) || (index >= _hitZoneListCount)) {
error("ObjectMap::getHitZone wrong index 0x%X", index);
// HACK: If we get a wrong hitzone, return the last hitzone in the list
// Normally, we don't get wrong hitzones in ITE, however IHNM still seems
// to have problems with some, therefore just throw a warning for now and
// continue with a valid hitzone
warning("ObjectMap::getHitZone wrong index 0x%X, adjusting it to 0x%X", index, _hitZoneListCount - 1);
index = _hitZoneListCount - 1;
}
return _hitZoneList[index];
}