diff options
author | Gregory Montoir | 2004-01-16 14:15:44 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-16 14:15:44 +0000 |
commit | 899843443f6ff6f92ea86fd0ddfbe682abf04b01 (patch) | |
tree | 9bcaae8305b70cf916684e2596d99368ea2ca22b /queen/command.cpp | |
parent | 11411767758dda1b7341c28e085064ee13c32c7b (diff) | |
download | scummvm-rg350-899843443f6ff6f92ea86fd0ddfbe682abf04b01.tar.gz scummvm-rg350-899843443f6ff6f92ea86fd0ddfbe682abf04b01.tar.bz2 scummvm-rg350-899843443f6ff6f92ea86fd0ddfbe682abf04b01.zip |
it seems entryObj can be <0, check for it
svn-id: r12433
Diffstat (limited to 'queen/command.cpp')
-rw-r--r-- | queen/command.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index 302db35072..8b0636c82c 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -434,18 +434,19 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa if (v == VERB_WALK_TO) { _vm->logic()->entryObj(objData->entryObj); - if (objData->entryObj != 0) { - _vm->logic()->newRoom(_vm->logic()->objectData(objData->entryObj)->room); - // because this is an exit object, see if there is - // a walk off point and set (x,y) accordingly - WalkOffData *wod = _vm->logic()->walkOffPointForObject(objNum); - if (wod != NULL) { - x = wod->x; - y = wod->y; - } - } } else { _vm->logic()->entryObj(0); + } + if (objData->entryObj > 0 && v != VERB_CLOSE) { + _vm->logic()->newRoom(_vm->logic()->objectData(objData->entryObj)->room); + // because this is an exit object, see if there is + // a walk off point and set (x,y) accordingly + WalkOffData *wod = _vm->logic()->walkOffPointForObject(objNum); + if (wod != NULL) { + x = wod->x; + y = wod->y; + } + } else { _vm->logic()->newRoom(0); } |