Make 'sv_usercmd_dualwield_enable' server and client

Must be for server and client, as its used in shared code.
This commit is contained in:
Kawe Mazidjatari 2023-07-19 02:14:09 +02:00
parent d5f35349a8
commit dccb897c27
3 changed files with 7 additions and 5 deletions

View File

@ -26,6 +26,8 @@ ConVar* fps_max = nullptr;
ConVar* usercmd_frametime_max = nullptr;
ConVar* usercmd_frametime_min = nullptr;
ConVar* usercmd_dualwield_enable = nullptr;
ConVar* staticProp_no_fade_scalar = nullptr;
ConVar* staticProp_gather_size_weight = nullptr;
@ -115,7 +117,6 @@ ConVar* sv_voiceEcho = nullptr;
ConVar* sv_voiceenable = nullptr;
ConVar* sv_alltalk = nullptr;
ConVar* sv_usercmd_dualwield_enable = nullptr;
ConVar* player_userCmdsQueueWarning = nullptr;
//#ifdef DEDICATED
@ -327,8 +328,6 @@ void ConVar_StaticInit(void)
sv_validatePersonaName = ConVar::StaticCreate("sv_validatePersonaName" , "1" , FCVAR_RELEASE, "Validate the client's textual persona name on connect.", true, 0.f, false, 0.f, nullptr, nullptr);
sv_minPersonaNameLength = ConVar::StaticCreate("sv_minPersonaNameLength", "4" , FCVAR_RELEASE, "The minimum length of the client's textual persona name.", true, 0.f, false, 0.f, nullptr, nullptr);
sv_maxPersonaNameLength = ConVar::StaticCreate("sv_maxPersonaNameLength", "16", FCVAR_RELEASE, "The maximum length of the client's textual persona name.", true, 0.f, false, 0.f, nullptr, nullptr);
sv_usercmd_dualwield_enable = ConVar::StaticCreate("sv_usercmd_dualwield_enable", "0", FCVAR_RELEASE, "Allows setting dual wield cycle slots, and activating multiple inventory weapons from UserCmd.", false, 0.f, false, 0.f, nullptr, nullptr);
#endif // !CLIENT_DLL
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1)
bhit_depth_test = ConVar::StaticCreate("bhit_depth_test", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED, "Use depth test for bullet ray trace overlay.", false, 0.f, false, 0.f, nullptr, nullptr);
@ -405,6 +404,8 @@ void ConVar_StaticInit(void)
// Taken from S15:
usercmd_frametime_max = ConVar::StaticCreate("usercmd_frametime_max", "0.100", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "The largest amount of simulation seconds a UserCmd can have.", false, 0.f, false, 0.f, nullptr, nullptr);
usercmd_frametime_min = ConVar::StaticCreate("usercmd_frametime_min", "0.002857", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "The smallest amount of simulation seconds a UserCmd can have.", false, 0.f, false, 0.f, nullptr, nullptr);
usercmd_dualwield_enable = ConVar::StaticCreate("usercmd_dualwield_enable", "0", FCVAR_RELEASE, "Allows setting dual wield cycle slots, and activating multiple inventory weapons from UserCmd.", false, 0.f, false, 0.f, nullptr, nullptr);
//-------------------------------------------------------------------------
// FILESYSTEM |
fs_showWarnings = ConVar::StaticCreate("fs_showWarnings" , "0", FCVAR_DEVELOPMENTONLY, "Logs the FileSystem warnings to the console, filtered by 'fs_warning_level' ( !slower! ).", true, 0.f, true, 2.f, nullptr, "0 = log to file. 1 = 0 + log to console. 2 = 1 + log to notify.");

View File

@ -17,6 +17,8 @@ extern ConVar* fps_max;
extern ConVar* usercmd_frametime_max;
extern ConVar* usercmd_frametime_min;
extern ConVar* usercmd_dualwield_enable;
extern ConVar* staticProp_no_fade_scalar;
extern ConVar* staticProp_gather_size_weight;
@ -105,7 +107,6 @@ extern ConVar* sv_voiceEcho;
extern ConVar* sv_voiceenable;
extern ConVar* sv_alltalk;
extern ConVar* sv_usercmd_dualwield_enable;
extern ConVar* player_userCmdsQueueWarning;
//#ifdef DEDICATED

View File

@ -52,7 +52,7 @@ int ReadUserCmd(bf_read* buf, CUserCmd* move, CUserCmd* from)
// Checks are only required if cycleslot is valid; see 'CPlayer::UpdateWeaponSlots'.
if (move->cycleslot != WEAPON_INVENTORY_SLOT_INVALID)
{
const bool dualWieldEnabled = sv_usercmd_dualwield_enable->GetBool();
const bool dualWieldEnabled = usercmd_dualwield_enable->GetBool();
// Client could instruct the server to switch cycle slots for inventory
// weapons, however, the client could also cycle to the dual wield slots.