aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2004-01-16 14:15:44 +0000
committerGregory Montoir2004-01-16 14:15:44 +0000
commit899843443f6ff6f92ea86fd0ddfbe682abf04b01 (patch)
tree9bcaae8305b70cf916684e2596d99368ea2ca22b /queen
parent11411767758dda1b7341c28e085064ee13c32c7b (diff)
downloadscummvm-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')
-rw-r--r--queen/command.cpp21
-rw-r--r--queen/logic.cpp3
2 files changed, 11 insertions, 13 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);
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 38c9a23112..dac66f6547 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -608,9 +608,6 @@ ObjectData *Logic::setupJoeInRoom(bool autoPosition, uint16 scale) {
debug(9, "Logic::setupJoeInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y);
WalkOffData *pwo = NULL;
ObjectData *pod = objectData(_entryObj);
- if (pod == NULL) {
- error("Logic::setupJoeInRoom() - No object data for obj %d", _entryObj);
- }
uint16 oldx, oldy;
if (!autoPosition || joeX() != 0 || joeY() != 0) {