From 1c24ae3fadea6694d54dc6da7359678d7201969b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 Feb 2020 22:46:18 +0100 Subject: [PATCH] - restrict cl_weaponswitch to 0 and 1 for Shadow Warrior. --- source/common/gamecontrol.cpp | 2 ++ source/common/gamecvars.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/gamecontrol.cpp b/source/common/gamecontrol.cpp index d5a2b22a6..9854eaa9f 100644 --- a/source/common/gamecontrol.cpp +++ b/source/common/gamecontrol.cpp @@ -619,6 +619,8 @@ int RunGame() { hud_size.SetGenericRepDefault(8, CVAR_Int); hud_size_max = 9; + cl_weaponswitch.SetGenericRepDefault(1, CVAR_Int); + if (cl_weaponswitch > 1) cl_weaponswitch = 1; } if (g_gameType & GAMEFLAG_PSEXHUMED) { diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index 1608b4c16..f4becbcd0 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -99,9 +99,9 @@ CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable wea }; CUSTOM_CVARD(Int, cl_weaponswitch, 3, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable auto weapon switching") - { if (self < 0) self = 0; + 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.)