diff options
Diffstat (limited to 'engines/saga/sfuncs.cpp')
-rw-r--r-- | engines/saga/sfuncs.cpp | 24 |
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); |