diff options
author | Paul Gilbert | 2015-10-16 19:59:31 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-10-16 19:59:31 -0400 |
commit | ee1ef54f377fa959e05e365514201c44b7ed0c58 (patch) | |
tree | 85560a186107bf5c1193ec74a63c2613476c70ce /engines/sherlock | |
parent | d4774d1cb21507c66a438746619c69a11ce321d0 (diff) | |
download | scummvm-rg350-ee1ef54f377fa959e05e365514201c44b7ed0c58.tar.gz scummvm-rg350-ee1ef54f377fa959e05e365514201c44b7ed0c58.tar.bz2 scummvm-rg350-ee1ef54f377fa959e05e365514201c44b7ed0c58.zip |
SHERLOCK: RT: Fix crash showing folder to Watson
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/tattoo/widget_inventory.cpp | 8 |
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; } } |