From e3c5feee8997884dcadcdf50112acec39a85634e Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 24 Oct 2005 05:55:21 +0000 Subject: [PATCH] fix a use of cs.specialvisibilityradius before it was initialized (thanks to gcc 4 for pointing out this bug) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5766 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sv_main.c b/sv_main.c index fe072186..73ddd1ef 100644 --- a/sv_main.c +++ b/sv_main.c @@ -570,7 +570,7 @@ void SV_PrepareEntitiesForSending(void) if (effects & EF_STARDUST) specialvisibilityradius = max(specialvisibilityradius, 100); } - if (e > svs.maxclients && (!modelindex && !cs.specialvisibilityradius)) + if (e > svs.maxclients && (!modelindex && !specialvisibilityradius)) continue; cs = defaultstate; @@ -681,12 +681,12 @@ void SV_PrepareEntitiesForSending(void) } if (specialvisibilityradius) { - cullmins[0] = min(cullmins[0], cs.origin[0] - cs.specialvisibilityradius); - cullmins[1] = min(cullmins[1], cs.origin[1] - cs.specialvisibilityradius); - cullmins[2] = min(cullmins[2], cs.origin[2] - cs.specialvisibilityradius); - cullmaxs[0] = max(cullmaxs[0], cs.origin[0] + cs.specialvisibilityradius); - cullmaxs[1] = max(cullmaxs[1], cs.origin[1] + cs.specialvisibilityradius); - cullmaxs[2] = max(cullmaxs[2], cs.origin[2] + cs.specialvisibilityradius); + cullmins[0] = min(cullmins[0], cs.origin[0] - specialvisibilityradius); + cullmins[1] = min(cullmins[1], cs.origin[1] - specialvisibilityradius); + cullmins[2] = min(cullmins[2], cs.origin[2] - specialvisibilityradius); + cullmaxs[0] = max(cullmaxs[0], cs.origin[0] + specialvisibilityradius); + cullmaxs[1] = max(cullmaxs[1], cs.origin[1] + specialvisibilityradius); + cullmaxs[2] = max(cullmaxs[2], cs.origin[2] + specialvisibilityradius); } if (!VectorCompare(cullmins, ent->priv.server->cullmins) || !VectorCompare(cullmaxs, ent->priv.server->cullmaxs)) { -- 2.39.2