IHNM and ITE: ScummVM will no longer crash when loading games from the command line

svn-id: r28394
This commit is contained in:
Filippos Karapetis 2007-08-01 21:47:17 +00:00
parent 79c67653b6
commit 617a500ef2
2 changed files with 7 additions and 1 deletions

View file

@ -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);