MADS: Fixes for using items on other items

This commit is contained in:
Paul Gilbert
2014-04-30 21:28:49 -04:00
parent e24292a72f
commit b7776bdbdd
2 changed files with 15 additions and 5 deletions
+14 -4
View File
@@ -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;
+1 -1
View File
@@ -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 {