shithub: choc

Download patch

ref: 5130b54658ab03f3fc18727615b529d6e241566c
parent: b18d59086a504e54bba901037bd80908ed9a5acd
author: Simon Howard <[email protected]>
date: Wed Jan 12 18:22:20 EST 2011

Fix menu navigation when using joystick / joypad (thanks AlexXav).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2237

--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+1.6.0 (2011-??-??):
+
+    Bugs fixed:
+     * Menu navigation when using joystick/joypad (thanks AlexXav).
+
 1.5.0 (2011-01-02):
 
     Big changes in this version:
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1450,23 +1450,23 @@
 	
     if (ev->type == ev_joystick && joywait < I_GetTime())
     {
-	if (ev->data3 == -1)
+	if (ev->data3 < 0)
 	{
 	    key = key_menu_up;
 	    joywait = I_GetTime() + 5;
 	}
-	else if (ev->data3 == 1)
+	else if (ev->data3 > 0)
 	{
 	    key = key_menu_down;
 	    joywait = I_GetTime() + 5;
 	}
 		
-	if (ev->data2 == -1)
+	if (ev->data2 < 0)
 	{
 	    key = key_menu_left;
 	    joywait = I_GetTime() + 2;
 	}
-	else if (ev->data2 == 1)
+	else if (ev->data2 > 0)
 	{
 	    key = key_menu_right;
 	    joywait = I_GetTime() + 2;