shithub: patch

ref: aa01a19cd7d467949d02c557591b9d9c5a11a66d
dir: /doom-autorun/

View raw version
doom: add autorun configuration option

an autorun option avoids having the shift key swapping mouse buttons 2
and 3 when playing with the mouse (or remapping the run key...)

diff -r bd0ff7078273 sys/src/games/doom/g_game.c
--- a/sys/src/games/doom/g_game.c	Mon Aug 28 19:45:49 2017 +0200
+++ b/sys/src/games/doom/g_game.c	Wed Aug 30 11:09:52 2017 +0200
@@ -153,6 +153,7 @@
 int		key_use;
 int		key_strafe;
 int		key_speed; 
+int		autorun;
  
 int             mousebfire; 
 int             mousebstrafe; 
@@ -252,7 +253,7 @@
  
     strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe] 
 	|| joybuttons[joybstrafe]; 
-    speed = gamekeydown[key_speed] || joybuttons[joybspeed];
+    speed = autorun || gamekeydown[key_speed] || joybuttons[joybspeed];
  
     forward = side = 0;
     
diff -r bd0ff7078273 sys/src/games/doom/m_misc.c
--- a/sys/src/games/doom/m_misc.c	Mon Aug 28 19:45:49 2017 +0200
+++ b/sys/src/games/doom/m_misc.c	Wed Aug 30 11:09:52 2017 +0200
@@ -172,6 +172,7 @@
 extern int	viewwidth;
 extern int	viewheight;
 
+extern int	autorun;
 extern int	mouseSensitivity;
 extern int	showMessages;
 
@@ -213,6 +214,7 @@
     {"key_use",&key_use, ' '},
     {"key_strafe",&key_strafe, KEY_RALT},
     {"key_speed",&key_speed, KEY_RSHIFT},
+    {"autorun",&autorun, 0},
 
     {"use_mouse",&usemouse, 1},
     {"mouseb_fire",&mousebfire,0},