From a8e01ee69b02e127bbb343006af6a704df3eecd4 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Thu, 22 Nov 2018 14:47:01 -0500 Subject: [PATCH] Smarter pause/break rejection for setcontrol --- src/g_input.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 45ab29e0..add7c2fc 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1327,13 +1327,31 @@ static void setcontrol(INT32 (*gc)[2], INT32 na) return; } keynum = G_KeyStringtoNum(COM_Argv(2)); + if (keynum == KEY_PAUSE) // fail silently; pause is hardcoded - return; + { + if (na == 4) + { + na--; + keynum = G_KeyStringtoNum(COM_Argv(3)); + if (keynum == KEY_PAUSE) + return; + } + else + return; + } + G_CheckDoubleUsage(keynum); gc[numctrl][0] = keynum; if (na == 4) - gc[numctrl][1] = G_KeyStringtoNum(COM_Argv(3)); + { + keynum = G_KeyStringtoNum(COM_Argv(3)); + if (keynum != KEY_PAUSE) + gc[numctrl][1] = keynum; + else + gc[numctrl][1] = 0; + } else gc[numctrl][1] = 0; }