From 3e2012483d9543e9e5f65fcbf038e9d2f915639f Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Tue, 27 Dec 2011 08:47:59 +0100 Subject: SCUMM: make verbs working better --- engines/scumm/verbs.cpp | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'engines') diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 67ed17c024..3398cca05c 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -1083,6 +1083,10 @@ void ScummEngine_v0::checkExecVerbs() { int prevInventory = _activeInventory; int invOff = _inventoryOffset; + // GIVE: actor must be selected (not possible via inventory) + if ((_activeVerb == 3) && (_activeObject || _activeInventory)) + return; + // Click into V2 inventory checkV2Inventory(_mouse.x, _mouse.y); @@ -1137,13 +1141,6 @@ void ScummEngine_v0::checkExecVerbs() { int obj = findObject(_virtualMouse.x, _virtualMouse.y); int objIdx = findObjectIndex(_virtualMouse.x, _virtualMouse.y); - // If we already have an object selected, and we just clicked an actor - // Clear any object we may of also clicked on - if ((_activeObject || _activeInventory) && act) { - obj = 0; - objIdx = 0; - } - if (a->_miscflags & 0x80) { if (_activeVerb != 7 && over != 7) { _activeVerb = 0; @@ -1208,14 +1205,27 @@ void ScummEngine_v0::checkExecVerbs() { return; } - // Only allowing targetting actors if its the GIVE/USE verb - if (_activeVerb == 3 || _activeVerb == 11) { - // Different actor selected? - if (act) { - if (_activeActor != act) { - _activeActor = act; + // Only allowing targetting actors if its the GIVE verb + if (_activeVerb == 3) { + if (_activeObject || _activeInventory) { + // Once selected the object cannot be changed + obj = 0; + objIdx = 0; + + // Different actor selected? + if (act) { + if (_activeActor != act) { + _activeActor = act; + return; + } + } else { return; } + } else { + // An object has to be selected first + act = 0; + if (!obj) + return; } } @@ -1224,9 +1234,12 @@ void ScummEngine_v0::checkExecVerbs() { if (_activeInventory) _activeInvExecute = true; - // USE + // USE / UNLOCK if (_activeVerb == 11 || _activeVerb == 8) { - if (obj != _activeObject || obj != _activeObject2) { + if (obj != _activeObject && obj != _activeObject2) { + if (_activeObject || _activeInventory) { + //verbPrep( + } if (!_activeObject || _activeInventory) { _activeObject = obj; _activeObjectIndex = objIdx; -- cgit v1.2.3