From 57a3f89105b45d4dadb757c88e28442178762774 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 16 Feb 2020 21:31:29 +0100 Subject: [PATCH] - workaround for cl_autoaim not being set anymore. Only for singleplayer for now, the network implementation for this flag leaves a lot to be desired. --- source/blood/src/controls.cpp | 7 +++++++ source/common/gamecvars.cpp | 2 -- source/duke3d/src/player.cpp | 8 ++++++++ source/rr/src/player.cpp | 22 ++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index bd3a30efd..235b7be7f 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "baselayer.h" +#include "mmulti.h" #include "gamecontrol.h" #include "common_game.h" #include "blood.h" @@ -85,6 +86,12 @@ void ctrlGetInput(void) bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming); if (!mouseaim) gInput.keyFlags.lookCenter = 1; + if (numplayers == 1) + { + gProfile[myconnectindex].nAutoAim = cl_autoaim; + gProfile[myconnectindex].nWeaponSwitch = cl_weaponswitch; + } + CONTROL_GetInput(&info); if (gQuitRequest) diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index d38932b0f..e67366b58 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -95,7 +95,6 @@ CUSTOM_CVARD(Int, cl_crosshairscale, 50, CVAR_ARCHIVE, "changes the size of the CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable weapon autoaim") { if (self < 0 || self > ((g_gameType & GAMEFLAG_BLOOD)? 2 : 3)) self = 1; // The Shadow Warrior backend only has a bool for this. - //UpdatePlayerFromMenu(); todo: networking (only operational in EDuke32 frontend anyway.) }; CUSTOM_CVARD(Int, cl_weaponswitch, 3, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable auto weapon switching") @@ -104,7 +103,6 @@ CUSTOM_CVARD(Int, cl_weaponswitch, 3, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disabl if (self > 1 && (g_gameType & GAMEFLAG_SW)) self = 1; if (self > 3 && (g_gameType & GAMEFLAG_BLOOD)) self = 3; if (self > 7) self = 7; - //UpdatePlayerFromMenu(); todo: networking (only operational in EDuke32 frontend anyway.) } diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 9fe0b4946..1510941b3 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2921,6 +2921,14 @@ void P_GetInput(int const playerNum) bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming); + if (numplayers == 1) + { + pPlayer->aim_mode = in_mousemode; + pPlayer->auto_aim = cl_autoaim; + pPlayer->weaponswitch = cl_weaponswitch; + } + + CONTROL_GetInput(&info); // JBF: Run key behaviour is selectable diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 12afb581c..8f219ff2e 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -3146,6 +3146,14 @@ void P_GetInput(int playerNum) bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming); + if (numplayers == 1) + { + pPlayer->aim_mode = in_mousemode; + pPlayer->auto_aim = cl_autoaim; + pPlayer->weaponswitch = cl_weaponswitch; + } + + CONTROL_GetInput(&info); @@ -3420,6 +3428,13 @@ void P_GetInputMotorcycle(int playerNum) bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming); + if (numplayers == 1) + { + pPlayer->aim_mode = in_mousemode; + pPlayer->auto_aim = cl_autoaim; + pPlayer->weaponswitch = cl_weaponswitch; + } + CONTROL_GetInput(&info); // JBF: Run key behaviour is selectable @@ -3685,6 +3700,13 @@ void P_GetInputBoat(int playerNum) bool mouseaim = in_mousemode || buttonMap.ButtonDown(gamefunc_Mouse_Aiming); + if (numplayers == 1) + { + pPlayer->aim_mode = in_mousemode; + pPlayer->auto_aim = cl_autoaim; + pPlayer->weaponswitch = cl_weaponswitch; + } + CONTROL_GetInput(&info); // JBF: Run key behaviour is selectable