diff options
author | Filippos Karapetis | 2007-08-01 21:47:17 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-08-01 21:47:17 +0000 |
commit | 617a500ef243df46dafbe7e036e3ea220b0feb78 (patch) | |
tree | cc1b7626c76994ef3abd5764074b6a2f04f98147 /engines | |
parent | 79c67653b63b23143fc89004bd5106919f85d5b5 (diff) | |
download | scummvm-rg350-617a500ef243df46dafbe7e036e3ea220b0feb78.tar.gz scummvm-rg350-617a500ef243df46dafbe7e036e3ea220b0feb78.tar.bz2 scummvm-rg350-617a500ef243df46dafbe7e036e3ea220b0feb78.zip |
IHNM and ITE: ScummVM will no longer crash when loading games from the command line
svn-id: r28394
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/actor.cpp | 4 | ||||
-rw-r--r-- | engines/saga/script.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 5cb91b8663..c2ecff4a1a 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -897,7 +897,9 @@ void Actor::updateActorsScene(int actorsEntrance) { } } - assert(_protagonist); + // _protagonist can be null while loading a game from the command line + if (_protagonist == NULL) + return; if ((actorsEntrance >= 0) && (_vm->_scene->_entryList.entryListCount > 0)) { if (_vm->_scene->_entryList.entryListCount <= actorsEntrance) { diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 262d63c51f..82fcb352c0 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -750,6 +750,10 @@ void Script::whichObject(const Point& mousePoint) { _leftButtonVerb = _currentVerb; newRightButtonVerb = getVerbType(kVerbNone); + // _protagonist can be null while loading a game from the command line + if (_vm->_actor->_protagonist == NULL) + return; + if (_vm->_actor->_protagonist->_currentAction != kActionWalkDir) { if (_vm->_scene->getHeight() >= mousePoint.y) { newObjectId = _vm->_actor->hitTest(mousePoint, true); |