From 399388d177eee0a80211342c779e01af610f91ca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 26 Sep 2020 22:26:26 +0200 Subject: [PATCH] - transmit the actual run mode in BT_RUN, because BT_SPEED was poorly designed. --- src/d_event.h | 2 ++ src/g_game.cpp | 1 + wadsrc/static/zscript/constants.zs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/d_event.h b/src/d_event.h index 7188f6ccc..822286d0e 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -90,6 +90,8 @@ typedef enum BT_USER2 = 1<<22, BT_USER3 = 1<<23, BT_USER4 = 1<<24, + + BT_RUN = 1<<25, } buttoncode_t; // Called by IO functions when input is detected. diff --git a/src/g_game.cpp b/src/g_game.cpp index cb87715f8..5b991de39 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -691,6 +691,7 @@ void G_BuildTiccmd (ticcmd_t *cmd) if (buttonMap.ButtonDown(Button_MoveDown)) cmd->ucmd.buttons |= BT_MOVEDOWN; if (buttonMap.ButtonDown(Button_MoveUp)) cmd->ucmd.buttons |= BT_MOVEUP; if (buttonMap.ButtonDown(Button_ShowScores)) cmd->ucmd.buttons |= BT_SHOWSCORES; + if (speed) cmd->ucmd.buttons |= BT_RUN; // Handle joysticks/game controllers. float joyaxes[NUM_JOYAXIS]; diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 8b65a47dd..80fb3dde1 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -821,6 +821,8 @@ enum EButtons BT_USER2 = 1<<22, BT_USER3 = 1<<23, BT_USER4 = 1<<24, + + BT_RUN = 1<<25, }; // Flags for GetAngle