mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
sv_main: Second part of fixing the MAX_ENT_LEAFS issue (after bumping MAX_ENT_LEAFS to 32 in r967).
If an entity is visilbe from MAX_ENT_LEAFS (32) or more leafs, don't try to vis-cull it, just send it to the client. This should completely eliminate any flickering entities, no matter how many leafs they're visible from. This could potentially increase packet sizes a bit.. but ent->num_leafs == 32 never happens in id1 epsiode 1, so it will not cause any increase on those maps. hip1m1 has one entity (a rotator) that is caught by this change and will be always sent. see e.g. http://forums.inside3d.com/viewtopic.php?f=1&t=5554 http://www.celephais.net/board/view_thread.php?id=60452&start=1235 git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1069 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
15c41d6262
commit
71133d5a09
1 changed files with 9 additions and 2 deletions
|
@ -526,7 +526,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
|
|||
// find the client's PVS
|
||||
VectorAdd (clent->v.origin, clent->v.view_ofs, org);
|
||||
pvs = SV_FatPVS (org, sv.worldmodel);
|
||||
|
||||
|
||||
// send over all entities (excpet the client) that touch the pvs
|
||||
ent = NEXT_EDICT(sv.edicts);
|
||||
for (e=1 ; e<sv.num_edicts ; e++, ent = NEXT_EDICT(ent))
|
||||
|
@ -546,7 +546,14 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
|
|||
for (i=0 ; i < ent->num_leafs ; i++)
|
||||
if (pvs[ent->leafnums[i] >> 3] & (1 << (ent->leafnums[i]&7) ))
|
||||
break;
|
||||
if (i == ent->num_leafs)
|
||||
|
||||
// ericw -- added ent->num_leafs < MAX_ENT_LEAFS condition.
|
||||
//
|
||||
// if ent->num_leafs == MAX_ENT_LEAFS, the ent is visible from too many leafs
|
||||
// for us to say whether it's in the PVS, so don't try to vis cull it.
|
||||
// this commonly happens with rotators, because they often have huge bboxes
|
||||
// spanning the entire map, or really tall lifts, etc.
|
||||
if (i == ent->num_leafs && ent->num_leafs < MAX_ENT_LEAFS)
|
||||
continue; // not visible
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue