From 8283cec24d38987c03b3a86fa1a9246d7e65842e Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 26 Oct 2015 19:36:40 +1000 Subject: [PATCH] Allow single letter uldr, also make sure it isn't case sensitive --- qcsrc/common/minigames/minigame/bd.qc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 08b82778c6..99a4d98937 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -178,10 +178,11 @@ void bd_move(entity minigame, entity player, string dir ) return; // should not happen... TODO: end match? int dxs = 0, dys = 0; - if(dir == "up") { dxs = 0; dys = 1; } - if(dir == "down" || dir == "dn") { dxs = 0; dys = -1; } - if(dir == "left" || dir == "lt") { dxs = -1; dys = 0; } - if(dir == "right" || dir == "rt") { dxs = 1; dys = 0; } + string thedir = strtolower(dir); + if(thedir == "up" || thedir == "u") { dxs = 0; dys = 1; } + if(thedir == "down" || thedir == "dn" || thedir == "d") { dxs = 0; dys = -1; } + if(thedir == "left" || thedir == "lt" || thedir == "l") { dxs = -1; dys = 0; } + if(thedir == "right" || thedir == "rt" || thedir == "r") { dxs = 1; dys = 0; } int dx = bound(-1, dxs, 1); int dy = bound(-1, dys, 1); @@ -526,19 +527,19 @@ int bd_client_event(entity minigame, string event, ...) { case K_RIGHTARROW: case K_KP_RIGHTARROW: - bd_make_move(minigame, "rt"); + bd_make_move(minigame, "r"); return true; case K_LEFTARROW: case K_KP_LEFTARROW: - bd_make_move(minigame, "lt"); + bd_make_move(minigame, "l"); return true; case K_UPARROW: case K_KP_UPARROW: - bd_make_move(minigame, "up"); + bd_make_move(minigame, "u"); return true; case K_DOWNARROW: case K_KP_DOWNARROW: - bd_make_move(minigame, "dn"); + bd_make_move(minigame, "d"); return true; } } -- 2.39.2