]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ent_cs: don't remove on death, really
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 17 Nov 2015 08:08:12 +0000 (19:08 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 17 Nov 2015 08:08:12 +0000 (19:08 +1100)
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/ent_cs.qc
qcsrc/lib/net.qh

index 413df981fda771b968c9fbcc1ae28336954451c7..d29c18a60f226d98fd87f267c3e3f19355cee392 100644 (file)
@@ -94,8 +94,8 @@
                {
                        entity ps = PlayerSounds_from(ReadByte());
                        float r = ReadByte() / 255;
-                       int who = ReadByte();
-                       entity e = entcs_receiver[who - 1];
+                       int who = ReadByte() - 1;
+                       entity e = entcs_receiver[who];
                        UpdatePlayerSounds(e);
                        string s = e.(ps.m_playersoundfld);
                        string sample = GlobalSound_sample(s, r);
                        }
                        else
                        {
-                           LOG_WARNINGF("Missing entcs data for player %i\n", e);
+                           LOG_WARNINGF("Missing entcs data for player %d\n", who);
                 // Can this happen?
                                entity e = new(playersound);
                                e.origin = o;
index b1a9692819b490e13eb175f9f3e81be52f2642a3..d5dbf51b64ddd76358cae9de3385059cb44b3e74 100644 (file)
@@ -65,7 +65,7 @@
                    && player.deadflag == DEAD_NO // player must be alive
                    || player == to               // player is self
                ;
-               if (!valid) return false;
+               if (!valid) sf = 0;
                WriteHeader(MSG_ENTITY, ENT_CLIENT_ENTCS);
                WriteShort(MSG_ENTITY, sf);
                int i = 1;
index 7a43a49ebf630029d5b2196ee4fe0c71b36f985c..50461945722cbbf250b3b1f667be1e97f4ee1556 100644 (file)
@@ -5,6 +5,7 @@
        .int Version;  // deprecated, use SendFlags
        .int SendFlags;
        .bool(entity to, int sendflags) SendEntity;
+       /** return false to remove from the client */
        .bool(entity this, entity to, int sendflags) SendEntity3;
 
        bool SendEntity_self(entity to, int sendflags) { return self.SendEntity3(self, to, sendflags); }