Improve player networking/culling.

This commit is contained in:
Marco Cawthorne 2022-05-01 17:03:58 -07:00
parent ad18b8ec3d
commit 0f77b36804
Signed by: eukara
GPG Key ID: C196CD8BA993248A
1 changed files with 3 additions and 7 deletions

View File

@ -779,15 +779,11 @@ player::SendEntity
float
player::SendEntity(entity ePEnt, float fChanged)
{
/* remove our entity to other clients if we're dead */
if (health <= 0 && ePEnt != this) {
/* don't broadcast invisible players */
if (IsFakeSpectator() && ePEnt != this)
return (0);
}
/* target client isn't real, they have no client-side. abandon */
if (clienttype(ePEnt) != CLIENTTYPE_REAL) {
if (!GetModelindex() && ePEnt != this)
return (0);
}
WriteByte(MSG_ENTITY, ENT_PLAYER);
WriteFloat(MSG_ENTITY, fChanged);