From 914f850d31009d9f10ca5840c153a61f43508b4d Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Wed, 8 Oct 2014 12:40:14 +1000 Subject: [PATCH] Fix use of unitialized variables in mouse button handling --- src/guiFormSpecMenu.cpp | 13 ++++++++----- 1 file 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) -- 2.25.1