aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hugo/mouse.cpp8
-rw-r--r--engines/hugo/object.cpp12
-rw-r--r--engines/hugo/parser_v3d.cpp4
3 files changed, 10 insertions, 14 deletions
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 385dce2703..14ac1d7843 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -118,7 +118,7 @@ void MouseHandler::processRightClick(int16 objId, int16 cx, int16 cy) {
else if (gameStatus.inventoryObjId == objId)
gameStatus.inventoryObjId = -1; // Same icon - deselect it
else
- _vm->_object->useObject(objId); // Use status.objid on object
+ _vm->_object->useObject(objId); // Use status.objid on object
} else { // Clicked over viewport object
object_t *obj = &_vm->_object->_objects[objId];
int16 x, y;
@@ -130,12 +130,12 @@ void MouseHandler::processRightClick(int16 objId, int16 cx, int16 cy) {
_vm->_object->useObject(objId);
break;
case 0: // Immediate use
- _vm->_object->useObject(objId); // Pick up or use object
+ _vm->_object->useObject(objId); // Pick up or use object
break;
default: // Walk to view point if possible
if (!_vm->_route->startRoute(GO_GET, objId, obj->viewx, obj->viewy)) {
- if (_vm->_hero->cycling == INVISIBLE)// If invisible do
- _vm->_object->useObject(objId); // immediate use
+ if (_vm->_hero->cycling == INVISIBLE) // If invisible do
+ _vm->_object->useObject(objId); // immediate use
else
Utils::Box(BOX_ANY, "%s", _vm->_textMouse[kMsNoWayText]); // Can't get there
}
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 464e408b40..3316807c68 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -100,12 +100,8 @@ void ObjectHandler::useObject(int16 objId) {
// Get or use objid directly
if ((obj->genericCmd & TAKE) || obj->objValue) // Get collectible item
sprintf(_line, "%s %s", _vm->_arrayVerbs[_vm->_take][0], _vm->_arrayNouns[obj->nounIndex][0]);
- else if (obj->genericCmd & LOOK) // Look item
- sprintf(_line, "%s %s", _vm->_arrayVerbs[_vm->_look][0], _vm->_arrayNouns[obj->nounIndex][0]);
- else if (obj->genericCmd & DROP) // Drop item
- sprintf(_line, "%s %s", _vm->_arrayVerbs[_vm->_drop][0], _vm->_arrayNouns[obj->nounIndex][0]);
else if (obj->cmdIndex != 0) // Use non-collectible item if able
- sprintf(_line, "%s %s", _vm->_arrayVerbs[_vm->_cmdList[obj->cmdIndex][1].verbIndex][0], _vm->_arrayNouns[obj->nounIndex][0]);
+ sprintf(_line, "%s %s", _vm->_arrayVerbs[_vm->_cmdList[obj->cmdIndex][0].verbIndex][0], _vm->_arrayNouns[obj->nounIndex][0]);
else if ((verb = _vm->useBG(_vm->_arrayNouns[obj->nounIndex][0])) != 0)
sprintf(_line, "%s %s", verb, _vm->_arrayNouns[obj->nounIndex][0]);
else
@@ -142,10 +138,10 @@ void ObjectHandler::useObject(int16 objId) {
}
}
- if (_vm->getGameStatus().inventoryState == I_ACTIVE) // If inventory active, remove it
+ if (_vm->getGameStatus().inventoryState == I_ACTIVE) // If inventory active, remove it
_vm->getGameStatus().inventoryState = I_UP;
- _vm->getGameStatus().inventoryObjId = -1; // Deselect any dragged icon
- _vm->_parser->lineHandler(); // and process command
+ _vm->getGameStatus().inventoryObjId = -1; // Deselect any dragged icon
+ _vm->_parser->lineHandler(); // and process command
}
/**
diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp
index f1e4e8caba..395dc2a16b 100644
--- a/engines/hugo/parser_v3d.cpp
+++ b/engines/hugo/parser_v3d.cpp
@@ -277,7 +277,7 @@ bool Parser_v3d::isGenericVerb(object_t *obj, char *comment) {
Utils::Box(BOX_ANY, "%s", _vm->_textData[obj->stateDataIndex[obj->state]]);
} else {
if ((LOOK & obj->genericCmd) == LOOK) {
- if (_vm->_textData[obj->dataIndex])
+ if (obj->dataIndex != 0)
Utils::Box(BOX_ANY, "%s", _vm->_textData[obj->dataIndex]);
else
return false;
@@ -290,7 +290,7 @@ bool Parser_v3d::isGenericVerb(object_t *obj, char *comment) {
Utils::Box(BOX_ANY, "%s", _vm->_textParser[kTBHave]);
else if ((TAKE & obj->genericCmd) == TAKE)
takeObject(obj);
- else if (obj->cmdIndex != 0) // No comment if possible commands
+ else if (obj->cmdIndex) // No comment if possible commands
return false;
else if (!obj->verbOnlyFl && (TAKE & obj->genericCmd) == TAKE) // Make sure not taking object in context!
Utils::Box(BOX_ANY, "%s", _vm->_textParser[kTBNoUse]);