From ab2085f0e8ffd090bc2a6a028e1b4897edf0265d Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Fri, 29 Jun 2018 14:43:01 +0300 Subject: PINK: fixed sending leftClickMessage under some circumstances --- engines/pink/objects/actors/actor.h | 1 + engines/pink/objects/actors/lead_actor.cpp | 18 ++++++++++-------- engines/pink/objects/actors/supporting_actor.h | 2 ++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h index af11490998..ab84c6d417 100644 --- a/engines/pink/objects/actors/actor.h +++ b/engines/pink/objects/actors/actor.h @@ -57,6 +57,7 @@ public: void endAction() { _isActionEnded = true; } + virtual bool isSupporting() { return false; } virtual bool isCursor() { return false; } virtual bool isLeftClickHandlers() { return false; } diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp index be0e91a669..b7b4222136 100644 --- a/engines/pink/objects/actors/lead_actor.cpp +++ b/engines/pink/objects/actors/lead_actor.cpp @@ -215,14 +215,16 @@ void LeadActor::onLeftButtonClick(const Common::Point point) { if (this == clickedActor) { _audioInfoMgr.stop(); onClick(); - } else if (isInteractingWith(clickedActor)) { - _recipient = clickedActor; - if (!startWalk()) { - _audioInfoMgr.stop(); - if (_isHaveItem) - sendUseClickMessage(clickedActor); - else - sendLeftClickMessage(clickedActor); + } else if (clickedActor->isSupporting()) { + if (isInteractingWith(clickedActor)) { + _recipient = clickedActor; + if (!startWalk()) { + _audioInfoMgr.stop(); + if (_isHaveItem) + sendUseClickMessage(clickedActor); + else + sendLeftClickMessage(clickedActor); + } } } else clickedActor->onLeftClickMessage(); diff --git a/engines/pink/objects/actors/supporting_actor.h b/engines/pink/objects/actors/supporting_actor.h index 69ccd03b3a..a037787eed 100644 --- a/engines/pink/objects/actors/supporting_actor.h +++ b/engines/pink/objects/actors/supporting_actor.h @@ -37,6 +37,8 @@ public: virtual void toConsole() override; + bool isSupporting() override { return true; } + bool isLeftClickHandlers() override; bool isUseClickHandlers(InventoryItem *item) override; -- cgit v1.2.3