[Scummvm-git-logs] scummvm master -> 1f914ea7591dd457e4220b1eccb85cc0bbee1d42

bgK bastien.bouclet at gmail.com
Sat Jul 21 09:55:26 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1f914ea759 MOHAWK: MYST: Don't call the mouse up handler if executeMouseUp was used


Commit: 1f914ea7591dd457e4220b1eccb85cc0bbee1d42
    https://github.com/scummvm/scummvm/commit/1f914ea7591dd457e4220b1eccb85cc0bbee1d42
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-07-21T09:56:33+02:00

Commit Message:
MOHAWK: MYST: Don't call the mouse up handler if executeMouseUp was used

Fixes Trac#10573.

Changed paths:
    engines/mohawk/myst_card.cpp
    engines/mohawk/myst_card.h
    engines/mohawk/myst_stacks/channelwood.cpp


diff --git a/engines/mohawk/myst_card.cpp b/engines/mohawk/myst_card.cpp
index a587202..691f07d 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 056d211..7a40701 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 7e4e5e1..eb53321 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();
 }





More information about the Scummvm-git-logs mailing list