gl_fog.c (Fog_ParseServerMessage): fix reading time for svc_fog.

max() macro forces double read of its arguments, so MSG_ReadShort()
was being called twice, therefore it has always been broken since
more than 20 years, and not to mention its definition change going
from fitzquake v0.60 to v0.65. Darkplaces svn r1778 changelog says:
"minor cleaning of obsolete protocol stuff (svc_fog is now considered unused, because it really never was used)"
 http://svn.icculus.org/twilight?view=rev&revision=1778
 524e813007
FTEQW does it right by doing a single message read (svcfitz_fog)

We now do a single message read like FTEQW, as it should have been.
svc_fog message has probably never been emited by any mod's qc, so
no worries.
This commit is contained in:
Ozkan Sezer 2022-06-02 14:33:10 +03:00
parent fe62465d9e
commit 284b182a1c

View file

@ -100,7 +100,8 @@ void Fog_ParseServerMessage (void)
red = MSG_ReadByte() / 255.0;
green = MSG_ReadByte() / 255.0;
blue = MSG_ReadByte() / 255.0;
time = q_max(0.0, MSG_ReadShort() / 100.0);
time = MSG_ReadShort() / 100.0;
if (time < 0.0f) time = 0.0f;
Fog_Update (density, red, green, blue, time);
}