diff options
-rw-r--r-- | engines/mohawk/myst_card.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_card.h | 7 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.cpp | 3 |
3 files changed, 14 insertions, 0 deletions
diff --git a/engines/mohawk/myst_card.cpp b/engines/mohawk/myst_card.cpp index a58720264d..691f07d3d1 100644 --- a/engines/mohawk/myst_card.cpp +++ b/engines/mohawk/myst_card.cpp @@ -453,4 +453,8 @@ bool MystCard::isDraggingResource() const { return _clickedResource != nullptr; } +void MystCard::resetClickedResource() { + _clickedResource = nullptr; +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst_card.h b/engines/mohawk/myst_card.h index 056d211682..7a4070171c 100644 --- a/engines/mohawk/myst_card.h +++ b/engines/mohawk/myst_card.h @@ -67,6 +67,13 @@ public: /** Set the card's currently clicked resource to the currently active resource */ MystArea *forceUpdateClickedResource(const Common::Point &mouse); + /** Clear the card's currently clicked resource + * + * Used to indicate the mouse up event handler should not be called. + * (Possibly because it was already called by the gameplay logic + */ + void resetClickedResource(); + /** * Get the mouse cursor that should be used when hovering the currently active resource * diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 7e4e5e12b1..eb533213af 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -636,6 +636,9 @@ void Channelwood::o_hologramTemple(uint16 var, const ArgumentsArray &args) { } void Channelwood::o_executeMouseUp(uint16 var, const ArgumentsArray &args) { + // Clear the clicked resource so the mouse up event is not called a second time. + _vm->getCard()->resetClickedResource(); + MystArea *resource = _vm->getCard()->getResource<MystArea>(args[0]); resource->handleMouseUp(); } |