aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/sfuncs.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-06-05 15:04:25 +0000
committerFilippos Karapetis2007-06-05 15:04:25 +0000
commit2f033e7a4c844bc8747ca5c7f6789a94277a48a6 (patch)
tree39f4fa1f47a20b50a469be76b1967a14985f93d3 /engines/saga/sfuncs.cpp
parent95821c97eee8d46557dc4637877bd54f1db9b3e8 (diff)
downloadscummvm-rg350-2f033e7a4c844bc8747ca5c7f6789a94277a48a6.tar.gz
scummvm-rg350-2f033e7a4c844bc8747ca5c7f6789a94277a48a6.tar.bz2
scummvm-rg350-2f033e7a4c844bc8747ca5c7f6789a94277a48a6.zip
Check if a zone type is NULL for both ITE and IHNM, as it's done in the original. This fixes the crash in IHNM when entering the second floor of the zeppelin and the crash in ITE when interacting with the bowl in the tunnel, outside the prison. Removed the two relevant hacks
svn-id: r27108
Diffstat (limited to 'engines/saga/sfuncs.cpp')
-rw-r--r--engines/saga/sfuncs.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index bebacc39d3..fad2a26247 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -386,11 +386,13 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) {
break;
case kGameObjectHitZone:
case kGameObjectStepZone:
- if (objectTypeId(objectId) == kGameObjectHitZone) {
+ if (objectTypeId(objectId) == NULL)
+ return;
+ else if (objectTypeId(objectId) == kGameObjectHitZone)
hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(objectId));
- } else {
+ else
hitZone = _vm->_scene->_actionMap->getHitZone(objectIdToIndex(objectId));
- }
+
scriptEntryPointNumber = hitZone->getScriptNumber();
moduleNumber = _vm->_scene->getScriptModuleNumber();
break;
@@ -729,20 +731,12 @@ void Script::sfEnableZone(SCRIPTFUNC_PARAMS) {
int16 flag = thread->pop();
HitZone *hitZone;
- if (objectTypeId(objectId) == kGameObjectHitZone) {
- hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(objectId));
- } else if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 1 &&
- _vm->_scene->currentSceneNumber() == 14) {
- // HACK: Don't disable the requested hitzone in room 14 in chapter 1 (Gorrister) of IHNM
- // Apparently, this is used in that room to disable the tear at the very end of the
- // corridor. This fixes the staircase in scenes 4 and 14
- // FIXME: Remove this hack
- warning("HACK: Prevent crash at staircase with Gorrister");
- // Do nothing
+ if (objectTypeId(objectId) == NULL)
return;
- } else {
+ else if (objectTypeId(objectId) == kGameObjectHitZone)
+ hitZone = _vm->_scene->_objectMap->getHitZone(objectIdToIndex(objectId));
+ else
hitZone = _vm->_scene->_actionMap->getHitZone(objectIdToIndex(objectId));
- }
if (flag) {
hitZone->setFlag(kHitZoneEnabled);