]> git.jsancho.org Git - lugaru.git/commitdiff
Fixed buffer overrun (misunderstanding about input system).
authorRyan C. Gordon <icculus@icculus.org>
Wed, 19 Aug 2009 04:40:29 +0000 (00:40 -0400)
committerRyan C. Gordon <icculus@icculus.org>
Wed, 19 Aug 2009 04:40:29 +0000 (00:40 -0400)
Source/OpenGL_Windows.cpp

index 1588b6456c4014505707bc2fe9fe047782132239..f42de3379010c390cc7f34bc99c17b0737c23fcd 100644 (file)
@@ -468,17 +468,10 @@ static void sdlEventProc(const SDL_Event &e, Game &game)
                case SDL_MOUSEBUTTONDOWN:
                        {
                 val = clamp_sdl_mouse_button(e.button.button);
-                if (val >= 0)
+                if ((val >= 0) && (val <= 2))
                 {
                     if (val == 0)
-                    {
                                    g_button = true;
-                        SetKey(MAC_MOUSEBUTTON1);
-                    }
-
-                    else if (val == 1)
-                        SetKey(MAC_MOUSEBUTTON2);
-
                                buttons[val] = true;
                 }
                        }
@@ -487,17 +480,10 @@ static void sdlEventProc(const SDL_Event &e, Game &game)
                case SDL_MOUSEBUTTONUP:
                        {
                 val = clamp_sdl_mouse_button(e.button.button);
-                if (val >= 0)
+                if ((val >= 0) && (val <= 2))
                 {
                     if (val == 0)
-                    {
                                    g_button = false;
-                        ClearKey(MAC_MOUSEBUTTON1);
-                    }
-
-                    else if (val == 1)
-                        ClearKey(MAC_MOUSEBUTTON2);
-
                                buttons[val] = false;
                 }
                        }