diff options
author | Gregory Montoir | 2004-01-16 20:26:30 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-16 20:26:30 +0000 |
commit | 99500a0112e05ad73a67dc51e6fdfb59b1bf4f1f (patch) | |
tree | 75517eccd7b6359248ad61ee0d91c56e72f6ed47 /queen/command.cpp | |
parent | 19ad2d0120def7bd22ee8e37630c4d1e5fc1c65c (diff) | |
download | scummvm-rg350-99500a0112e05ad73a67dc51e6fdfb59b1bf4f1f.tar.gz scummvm-rg350-99500a0112e05ad73a67dc51e6fdfb59b1bf4f1f.tar.bz2 scummvm-rg350-99500a0112e05ad73a67dc51e6fdfb59b1bf4f1f.zip |
- removed noisy warning in talk code
- set _entryObj only if verb is WALK_TO
- changed setConditions code in Command::openOrCloseAssociatedObject to be
consistent with Command::setConditions ; this isn't like the original, but
more logical to me.
svn-id: r12441
Diffstat (limited to 'queen/command.cpp')
-rw-r--r-- | queen/command.cpp | 37 |
1 files changed, 17 insertions, 20 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); |