From 5c4a43fc6c95ffad714ba33b9f5c9e5e20fdfbba Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 17 Nov 2015 18:42:44 +1100 Subject: [PATCH] ent_cs: don't remove on death --- qcsrc/common/ent_cs.qc | 16 ++++++---------- qcsrc/common/ent_cs.qh | 2 -- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 3132ec323..b1a969281 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -49,15 +49,6 @@ if (i >= BITS(16 - 1)) LOG_FATAL("Exceeded ENTCS_NETPROPS limit"); } - bool entcs_customize() - { - SELFPARAM(); - entity player = this.owner; - return IS_PLAYER(player) // player must be active - && player.deadflag == DEAD_NO // player must be alive - ; - } - bool entcs_send(entity this, entity to, int sf) { entity player = this.owner; @@ -69,6 +60,12 @@ } sf |= this.m_forceupdate; this.m_forceupdate = 0; + bool valid = + IS_PLAYER(player) // player must be active + && player.deadflag == DEAD_NO // player must be alive + || player == to // player is self + ; + if (!valid) return false; WriteHeader(MSG_ENTITY, ENT_CLIENT_ENTCS); WriteShort(MSG_ENTITY, sf); int i = 1; @@ -103,7 +100,6 @@ e.think = entcs_think; e.nextthink = time; Net_LinkEntity(e, false, 0, entcs_send); - e.customizeentityforclient = entcs_customize; } void entcs_detach(entity player) diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index 598ff0514..c8eea2658 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -22,8 +22,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) .entity entcs; -bool entcs_customize(); - bool entcs_send(entity this, entity to, int sf); void entcs_think(); -- 2.39.2