shithub: choc

Download patch

ref: 0c74071858b7dc8df708519b1efffbf18d6ad954
parent: 32cdd54be55325983a087e3bd9461c1069b3a43c
author: Simon Howard <[email protected]>
date: Sun Sep 28 13:02:31 EDT 2008

Make the joybspeed autorun hack work in Heretic.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1303

--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -161,6 +161,8 @@
 int dclicktime, dclickstate, dclicks;
 int dclicktime2, dclickstate2, dclicks2;
 
+#define MAX_JOY_BUTTONS 20
+
 int joyxmove, joyymove;         // joystick values are repeated
 boolean joyarray[5];
 boolean *joybuttons = &joyarray[1];     // allow [-1]
@@ -238,8 +240,9 @@
 
     strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe]
         || joybuttons[joybstrafe];
-    speed = gamekeydown[key_speed] || joybuttons[joybspeed]
-        || joybuttons[joybspeed];
+    speed = joybspeed >= MAX_JOY_BUTTONS
+         || gamekeydown[key_speed]
+         || joybuttons[joybspeed];
 #ifdef __WATCOMC__
     if (useexterndriver)
     {