]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ent_cs: don't remove on death
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 17 Nov 2015 07:42:44 +0000 (18:42 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 17 Nov 2015 07:42:44 +0000 (18:42 +1100)
qcsrc/common/ent_cs.qc
qcsrc/common/ent_cs.qh

index 3132ec323173ed68d9a390f80a84a899ea60e318..b1a9692819b490e13eb175f9f3e81be52f2642a3 100644 (file)
                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;
                }
                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;
                e.think = entcs_think;
                e.nextthink = time;
                Net_LinkEntity(e, false, 0, entcs_send);
-               e.customizeentityforclient = entcs_customize;
        }
 
        void entcs_detach(entity player)
index 598ff0514254cde55dbaaec51fefe7075576cc9d..c8eea26589e858b2947f978e1680564b723d1f85 100644 (file)
@@ -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();