Common: cmd "weapon_reparse" should be FCVAR_GAMEDLL for dedicated

If sv_cheats is 1 and we run "weapon_reparse" on the client, the client will forward this command to the server as well so the server could reload its weapon scripts and be in-sync. However this command did not have the proper flags for this to function. Dedicated builds now have the right flags for this command, it now functions as intended.
This commit is contained in:
Kawe Mazidjatari committed 2025-05-10 15:32:17 +02:00
1 parent 5d05b1d7ab
commit 9a73a944ad
1 file changed
+15
+15
View File
@@ -430,6 +430,11 @@ void ConCommand_InitShipped(void)
ConCommand* convar_list = g_pCVar->FindCommand("convar_list");
ConCommand* convar_differences = g_pCVar->FindCommand("convar_differences");
ConCommand* convar_findByFlags = g_pCVar->FindCommand("convar_findByFlags");
#ifdef DEDICATED
ConCommand* weapon_reparse = g_pCVar->FindCommand("weapon_reparse");
#endif // DEDICATED
#ifndef DEDICATED
//-------------------------------------------------------------------------
// MATERIAL SYSTEM
@@ -453,6 +458,16 @@ void ConCommand_InitShipped(void)
map_background->m_fnCompletionCallback = Host_Background_f_CompletionFunc;
ss_map->m_fnCompletionCallback = Host_SSMap_f_CompletionFunc;
#ifdef DEDICATED
// This must be flagged FCVAR_GAMEDLL for dedi builds, because when this
// commend gets executed on the client, the server will be requested to
// reparse their weapon scripts as well through ServerCmd() which only
// works if this is a gamedll command. NOTE that this command has the
// cheats flags so adding this flag will not cause problems.
weapon_reparse->RemoveFlags(FCVAR_CLIENTDLL);
weapon_reparse->AddFlags(FCVAR_GAMEDLL);
#endif // DEDICATED
#ifndef DEDICATED
mat_crosshair->m_fnCommandCallback = Mat_CrossHair_f;
give->m_fnCompletionCallback = Game_Give_f_CompletionFunc;