From 2ab8b1f884330db850e4f7725905df94886ded55 Mon Sep 17 00:00:00 2001 From: In-line Date: Fri, 6 Jan 2017 10:54:31 +0400 Subject: [PATCH] SetCStrikeFlags once on server start --- rehlds/engine/cmd.cpp | 5 +++-- rehlds/engine/model.cpp | 3 ++- rehlds/engine/sv_main.cpp | 4 +++- rehlds/engine/sys_dll2.cpp | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/rehlds/engine/cmd.cpp b/rehlds/engine/cmd.cpp index 2022e1c..82a2ffc 100644 --- a/rehlds/engine/cmd.cpp +++ b/rehlds/engine/cmd.cpp @@ -458,8 +458,9 @@ void Cmd_Alias_f(void) return; } - SetCStrikeFlags(); // TODO: Do this once somewhere at the server start - +#ifndef REHLDS_FIXES + SetCStrikeFlags(); // DONE: Do this once somewhere at the server start +#endif if ((g_bIsCStrike || g_bIsCZero) && (!Q_stricmp(s, "cl_autobuy") || !Q_stricmp(s, "cl_rebuy") diff --git a/rehlds/engine/model.cpp b/rehlds/engine/model.cpp index 31fe4ce..c6283fc 100644 --- a/rehlds/engine/model.cpp +++ b/rehlds/engine/model.cpp @@ -310,8 +310,9 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean trackCRC) { p->firstCRCDone = 1; p->initialCRC = currentCRC; +#ifndef REHLDS_FIXES SetCStrikeFlags(); - +#endif if (!IsGameSubscribed("czero") && g_bIsCStrike && IsCZPlayerModel(currentCRC, mod->name) && g_pcls.state) { COM_ExplainDisconnection(TRUE, "Cannot continue with altered model %s, disconnecting.", mod->name); diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index 0dd0ada..7661635 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -5746,7 +5746,9 @@ void EXT_FUNC SV_ActivateServer_internal(int runPhysics) msg.cursize = 0; msg.flags = SIZEBUF_CHECK_OVERFLOW; +#ifndef REHLDS_FIXES SetCStrikeFlags(); +#endif Cvar_Set("sv_newunit", "0"); ContinueLoadingProgressBar("Server", 8, 0.0f); @@ -8044,4 +8046,4 @@ NOXREF qboolean BIsValveGame(void) return TRUE; } return FALSE; -} \ No newline at end of file +} diff --git a/rehlds/engine/sys_dll2.cpp b/rehlds/engine/sys_dll2.cpp index 5427499..a0fccc4 100644 --- a/rehlds/engine/sys_dll2.cpp +++ b/rehlds/engine/sys_dll2.cpp @@ -699,6 +699,9 @@ bool CDedicatedServerAPI::Init_noVirt(char *basedir, char *cmdline, CreateInterf Q_snprintf(text, ARRAYSIZE(text), "exec %s\n", servercfgfile.string); text[255] = 0; Cbuf_InsertText(text); +#ifdef REHLDS_FIXES // DONE: Set cstrike flags on server start + SetCStrikeFlags(); +#endif return true; }