aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/widget_inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sherlock/tattoo/widget_inventory.cpp')
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 3555ecdffd..b49e30b30d 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -641,10 +641,12 @@ void WidgetInventory::handleEvents() {
bool found = false;
if (ui._bgFound != -1) {
if (ui._personFound) {
+ Person &person = people[ui._bgFound - 1000];
+
for (int idx = 0; idx < 2; ++idx) {
- if (!people[ui._bgFound - 1000]._use[idx]._verb.compareToIgnoreCase(_verb) &&
- !people[ui._bgFound - 1000]._use[idx]._target.compareToIgnoreCase(_invTarget)) {
- ui.checkAction(people[ui._bgFound - 1000]._use[idx], ui._bgFound);
+ if (!person._use[idx]._verb.compareToIgnoreCase(_verb) &&
+ !person._use[idx]._target.compareToIgnoreCase(_invTarget)) {
+ ui.checkAction(person._use[idx], ui._bgFound);
found = true;
}
}