aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-10-08 12:40:14 +1000
committerShadowNinja <shadowninja@minetest.net>2014-10-08 14:56:29 -0400
commit914f850d31009d9f10ca5840c153a61f43508b4d (patch)
tree7d098e2ff71bf378214061931d15b1fab321a28f
parent7b548cd2b53a6ce834c869f818fb74a5b96680a5 (diff)
downloadminetest-914f850d31009d9f10ca5840c153a61f43508b4d.tar.gz
minetest-914f850d31009d9f10ca5840c153a61f43508b4d.tar.bz2
minetest-914f850d31009d9f10ca5840c153a61f43508b4d.zip
Fix use of unitialized variables in mouse button handling
-rw-r--r--src/guiFormSpecMenu.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 2439de7fa..a502c9682 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -2946,11 +2946,14 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
}
- if((event.EventType==EET_MOUSE_INPUT_EVENT &&
- event.MouseInput.Event != EMIE_MOUSE_MOVED) ||
- (event.MouseInput.Event == EMIE_MOUSE_MOVED &&
- event.MouseInput.isRightPressed() && getItemAtPos(m_pointer).i != getItemAtPos(m_old_pointer).i)){
- // Mouse event other than movement or crossing the border of inventory field while holding rmb
+ /* Mouse event other than movement, or crossing the border of inventory
+ field while holding right mouse button
+ */
+ if (event.EventType == EET_MOUSE_INPUT_EVENT &&
+ (event.MouseInput.Event != EMIE_MOUSE_MOVED ||
+ (event.MouseInput.Event == EMIE_MOUSE_MOVED &&
+ event.MouseInput.isRightPressed() &&
+ getItemAtPos(m_pointer).i != getItemAtPos(m_old_pointer).i))) {
// Get selected item and hovered/clicked item (s)