diff options
author | Paul Gilbert | 2014-04-30 21:28:49 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-04-30 21:28:49 -0400 |
commit | b7776bdbddba57a5503dcbf3fcb63cf44dfdb5cb (patch) | |
tree | 89fd1d279445483853460f3f692f36ac1e5a0483 | |
parent | e24292a72fd97062407f97100fd747161d4dbd56 (diff) | |
download | scummvm-rg350-b7776bdbddba57a5503dcbf3fcb63cf44dfdb5cb.tar.gz scummvm-rg350-b7776bdbddba57a5503dcbf3fcb63cf44dfdb5cb.tar.bz2 scummvm-rg350-b7776bdbddba57a5503dcbf3fcb63cf44dfdb5cb.zip |
MADS: Fixes for using items on other items
-rw-r--r-- | engines/mads/action.cpp | 18 | ||||
-rw-r--r-- | engines/mads/action.h | 2 |
2 files changed, 15 insertions, 5 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index e278ffb740..0a0e79c660 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -151,7 +151,7 @@ void MADSAction::set() { } } - // Handling for if a hotspot has been selected/highlighted + // Add in any necessary article if necessary if ((_hotspotId >= 0) && (_selectedRow >= 0) && (_articleNumber > 0) && (_verbType == VERB_THAT)) { flag = true; @@ -159,6 +159,7 @@ void MADSAction::set() { _statusText += " "; } + // Handling for hotspot if (_hotspotId >= 0) { if (_selectedRow < 0) { int verbId; @@ -197,8 +198,19 @@ void MADSAction::set() { } } + if (_secondObject >= 0) { + if (_secondObjectSource == CAT_INV_LIST || _secondObjectSource == CAT_INV_ANIM) { + InventoryObject &invObject = _vm->_game->_objects.getItem(_hotspotId); + _action._indirectObjectId = invObject._descId; + } else if (_secondObject < (int)scene._hotspots.size()) { + _action._indirectObjectId = scene._hotspots[_hotspotId]._vocabId; + } else { + _action._indirectObjectId = scene._hotspots[_hotspotId - scene._hotspots.size()]._vocabId; + } + } + if ((_hotspotId >= 0) && (_articleNumber > 0) && !flag) { - if (_articleNumber == -1) { + if (_articleNumber == 0xff) { if (_secondObject >= 0) { int articleNum = 0; @@ -212,7 +224,6 @@ void MADSAction::set() { } _statusText += kArticleList[articleNum]; - _statusText += " "; } } else if ((_articleNumber == VERB_LOOK) || (_vm->getGameID() != GType_RexNebular) || (scene._vocabStrings[_action._indirectObjectId] != kFenceStr)) { @@ -472,7 +483,6 @@ void MADSAction::checkActionAtMousePos() { case CAT_INV_LIST: case CAT_HOTSPOT: case CAT_INV_ANIM: - // TODO: We may not need a separate ActionMode2 enum _mainObjectSource = userInterface._category; _hotspotId = _pickedWord; break; diff --git a/engines/mads/action.h b/engines/mads/action.h index c588a42324..6e51e12483 100644 --- a/engines/mads/action.h +++ b/engines/mads/action.h @@ -62,7 +62,7 @@ enum VerbType { VERB_ONLY, VERB_THIS, VERB_THAT }; enum PrepType { PREP_NONE, PREP_WITH, PREP_TO, PREP_AT, PREP_FROM, PREP_ON, PREP_IN, - PREP_UNDER, PREP_BEHIND, PREP_RELATIONAL = -1 + PREP_UNDER, PREP_BEHIND, PREP_RELATIONAL = 0xff }; enum ScrCategory { |