diff --git a/cl_main.c b/cl_main.c index 9227cd53a..9e90da835 100644 --- a/cl_main.c +++ b/cl_main.c @@ -1127,6 +1127,8 @@ void CL_ClearState (void) if (!com_serveractive) Cvar_ForceSet (&host_mapname, ""); // Notice mapname not valid yet. + cl.fakeshaft_policy = 1; + CL_ProcessServerInfo(); // Force set some default variables, because server may not sent fullserverinfo. } diff --git a/cl_parse.c b/cl_parse.c index af881ecaa..e26d243e5 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -2311,6 +2311,21 @@ void CL_ProcessServerInfo (void) cl.racing = !strcmp(Info_ValueForKey(cl.serverinfo, "ktxmode"), "race"); + // Update fakeshaft limits + { + char* p = Info_ValueForKey(cl.serverinfo, "fakeshaft"); + if (!p[0]) { + p = Info_ValueForKey(cl.serverinfo, "truelightning"); + } + + if (p[0]) { + cl.fakeshaft_policy = bound(0, Q_atof(p), 1); + } + else { + cl.fakeshaft_policy = 1; + } + } + // Update skins if needed. skin_refresh = ( !new_teamplay != !cl.teamplay || ( (newfpd ^ cl.fpd) & (FPD_NO_FORCE_COLOR|FPD_NO_FORCE_SKIN) ) ); cl.teamplay = new_teamplay; diff --git a/cl_tent.c b/cl_tent.c index 768c4a017..24aab239f 100644 --- a/cl_tent.c +++ b/cl_tent.c @@ -727,14 +727,12 @@ void vectoangles(vec3_t vec, vec3_t ang); static float fakeshaft_policy (void) { - char *p; - if (cls.demoplayback || cl.spectator) + if (cls.demoplayback || cl.spectator) { return 1; - else - return *(p = Info_ValueForKey(cl.serverinfo, "fakeshaft")) ? - bound(0, Q_atof(p), 1) : - *(p = Info_ValueForKey(cl.serverinfo, "truelightning")) ? - bound(0, Q_atof(p), 1) : 1; + } + else { + return cl.fakeshaft_policy; + } } void CL_UpdateBeams(void) diff --git a/client.h b/client.h index bc6a3bc19..88aa49c7a 100644 --- a/client.h +++ b/client.h @@ -610,6 +610,8 @@ typedef struct { qbool racing; int race_pacemaker_ent; + + float fakeshaft_policy; } clientState_t; extern clientState_t cl;