From ee1ef54f377fa959e05e365514201c44b7ed0c58 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 16 Oct 2015 19:59:31 -0400 Subject: SHERLOCK: RT: Fix crash showing folder to Watson --- engines/sherlock/tattoo/widget_inventory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engines/sherlock/tattoo') 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; } } -- cgit v1.2.3