From 617a500ef243df46dafbe7e036e3ea220b0feb78 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 1 Aug 2007 21:47:17 +0000 Subject: IHNM and ITE: ScummVM will no longer crash when loading games from the command line svn-id: r28394 --- engines/saga/actor.cpp | 4 +++- engines/saga/script.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3