From: TimePath Date: Tue, 17 Nov 2015 07:42:44 +0000 (+1100) Subject: ent_cs: don't remove on death X-Git-Tag: xonotic-v0.8.2~1653^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5c4a43fc6c95ffad714ba33b9f5c9e5e20fdfbba;p=xonotic%2Fxonotic-data.pk3dir.git ent_cs: don't remove on death --- 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();