Ticket #9181: 0007-execute-merge-commands-after-inventory-is-closed.txt

File 0007-execute-merge-commands-after-inventory-is-closed.txt, 1.3 KB (added by fuzzie, 10 years ago)
Line 
1From 0ce5e9774e4187e448a3f5d103bee024a0877ddb Mon Sep 17 00:00:00 2001
2From: Alyssa Milburn <fuzzie@fuzzie.org>
3Date: Thu, 20 May 2010 14:34:53 +0200
4Subject: [PATCH] execute merge commands after inventory is closed
5
6---
7 engines/parallaction/input.cpp | 8 ++++++--
8 1 files changed, 6 insertions(+), 2 deletions(-)
9
10diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
11index 1b0e5c5..62eb192 100644
12--- a/engines/parallaction/input.cpp
13+++ b/engines/parallaction/input.cpp
14@@ -381,16 +381,16 @@ void Input::exitInventoryMode() {
15 int pos = _vm->getHoverInventoryItem(mousePos.x, mousePos.y);
16 _vm->highlightInventoryItem(-1); // disable
17
18+ ZonePtr z;
19 if ((_engineFlags & kEngineDragging)) {
20
21 _engineFlags &= ~kEngineDragging;
22- ZonePtr z = _vm->hitZone(kZoneMerge, _activeItem._index, _vm->getInventoryItemIndex(pos));
23+ z = _vm->hitZone(kZoneMerge, _activeItem._index, _vm->getInventoryItemIndex(pos));
24
25 if (z) {
26 _vm->dropItem(z->u._mergeObj1);
27 _vm->dropItem(z->u._mergeObj2);
28 _vm->addInventoryItem(z->u._mergeObj3);
29- _vm->_cmdExec->run(z->_commands);
30 }
31
32 }
33@@ -408,6 +408,10 @@ void Input::exitInventoryMode() {
34 _vm->resumeJobs();
35
36 _inputMode = kInputModeGame;
37+
38+ if (z) {
39+ _vm->_cmdExec->run(z->_commands);
40+ }
41 }
42
43 bool Input::updateInventoryInput() {
44--
451.6.3.3
46