From: terencehill <piuntn@gmail.com>
Date: Mon, 8 May 2017 16:06:19 +0000 (+0200)
Subject: Show joystick binds in the HUD only when a joystick is active (detected and enabled)
X-Git-Tag: xonotic-v0.8.5~2791
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=44182002afcc9fdeca93c8296185258d374f6513;p=xonotic%2Fxonotic-data.pk3dir.git

Show joystick binds in the HUD only when a joystick is active (detected and enabled)
---

diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc
index 91254e7ad..a098bd7f9 100644
--- a/qcsrc/client/main.qc
+++ b/qcsrc/client/main.qc
@@ -1232,7 +1232,7 @@ string _getcommandkey(string cmd_name, string command, bool forcename)
 	keys = db_get(binddb, command);
 	if (keys == "")
 	{
-		bool joy_detected = cvar("joy_detected");
+		bool joy_active = cvar("joy_active");
 		n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
 		for(j = 0; j < n; ++j)
 		{
@@ -1240,7 +1240,7 @@ string _getcommandkey(string cmd_name, string command, bool forcename)
 			if(k != -1)
 			{
 				string key = keynumtostring(k);
-				if(!joy_detected && substring(key, 0, 3) == "JOY")
+				if(!joy_active && substring(key, 0, 3) == "JOY")
 					continue;
 
 				if (keys == "")