From: TimePath Date: Tue, 17 Nov 2015 08:08:12 +0000 (+1100) Subject: ent_cs: don't remove on death, really X-Git-Tag: xonotic-v0.8.2~1653^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73e44dc16fa7cfdd48b25216190bcdfcc39f4871;p=xonotic%2Fxonotic-data.pk3dir.git ent_cs: don't remove on death, really --- diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index 413df981f..d29c18a60 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -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); @@ -114,7 +114,7 @@ } 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; diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index b1a969281..d5dbf51b6 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -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; diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index 7a43a49eb..504619457 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -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); }