]> git.mxchange.org Git - flightgear.git/commitdiff
don't use uninitialized variables
authorTorsten Dreyer <Torsten@t3r.de>
Sun, 9 Oct 2011 19:37:52 +0000 (21:37 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Sun, 9 Oct 2011 19:37:52 +0000 (21:37 +0200)
src/Main/FGEventHandler.cxx

index 950ccfd1003e01e112a6134f3865113cb2fc2aca..875da4b3fc469780210024cc5e331ef25381ff0a 100644 (file)
@@ -215,11 +215,13 @@ bool FGEventHandler::handle(const osgGA::GUIEventAdapter& ea,
                 button = 3;
             else if (ea.getScrollingDeltaY() < 0)
                 button = 4;
+            else
+                button = -1;
         } else if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP)
             button = 3;
         else
             button = 4;
-        if (mouseClickHandler) {
+        if (mouseClickHandler && button != -1) {
             (*mouseClickHandler)(button, 0, x, y, mainWindow, &ea);
             (*mouseClickHandler)(button, 1, x, y, mainWindow, &ea);
         }