diff options
-rw-r--r-- | queen/command.cpp | 37 | ||||
-rw-r--r-- | queen/talk.cpp | 3 |
2 files changed, 17 insertions, 23 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index b2811d7161..d1c7db7300 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -432,22 +432,20 @@ int16 Command::makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v, bool mustWa x = objData->x; y = objData->y; } - if (v == VERB_WALK_TO) { _vm->logic()->entryObj(objData->entryObj); - } 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; + 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()->entryObj(0); _vm->logic()->newRoom(0); } @@ -915,16 +913,15 @@ void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) { CmdListData *cmdList = &_cmdList[1]; uint16 com = 0; uint16 i; - for (i = 1; i <= _numCmdList; ++i, ++cmdList) { + for (i = 1; i <= _numCmdList && com == 0; ++i, ++cmdList) { if (cmdList->match(action, otherObj, 0)) { if (cmdList->setConditions) { - warning("using Command::openOrCloseAssociatedObject() with setConditions"); CmdGameState *cmdGs = _cmdGameState; + warning("Command::openOrCloseAssociatedObject() setConditions slot=%d", cmdGs[i].gameStateSlot); uint16 j; for (j = 1; j <= _numCmdGameState; ++j) { - // FIXME: weird, why using cmdGs[i] instead of cmdGs[j] ? - if (cmdGs[j].id == i && cmdGs[i].gameStateSlot > 0) { - if (_vm->logic()->gameState(cmdGs[i].gameStateSlot) == cmdGs[i].gameStateValue) { + if (cmdGs[j].id == i && cmdGs[j].gameStateSlot > 0) { + if (_vm->logic()->gameState(cmdGs[j].gameStateSlot) == cmdGs[j].gameStateValue) { com = i; break; } @@ -935,12 +932,12 @@ void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) { break; } } - } - - debug(6, "Command::openOrCloseAssociatedObject() - com=%X", com); + } if (com != 0) { + debug(6, "Command::openOrCloseAssociatedObject() com=%X", com); + cmdList = &_cmdList[com]; ObjectData *objData = _vm->logic()->objectData(otherObj); diff --git a/queen/talk.cpp b/queen/talk.cpp index a66b6d707f..ef9a4e2190 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -377,9 +377,6 @@ void Talk::findDialogueString(byte *ptr, int16 id, int16 max, char *str) { else ptr = getString(ptr, NULL, MAX_STRING_LENGTH, 4); } - - if (str[0] == '\0') - warning("Failed to find string with ID %i", id); } byte *Talk::loadDialogFile(const char *filename) { |