]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix wrong (outdated) health/armor values displayed above players when game (re)starts...
authorterencehill <piuntn@gmail.com>
Wed, 30 Jan 2019 14:41:18 +0000 (15:41 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 30 Jan 2019 17:02:53 +0000 (18:02 +0100)
Fixed by assigning values to entcs_sender entity fields when there are really sent, not when they are scheduled to be sent since there is a filter in between that can forbid sending them (private updates) leading to mismatching field values between entcs_sender and entcs_receiver entities

qcsrc/common/ent_cs.qc

index 36b8b587edea078fec656450ba5bb8acd1259383..ef028c9a20deb1987650b29ec4197d2a9180880d 100644 (file)
@@ -160,6 +160,7 @@ ENTCS_PROP(FRAGS, true, frags, ENTCS_SET_NORMAL,
                WriteShort(chan, sf);
                FOREACH(EntCSProps, sf & BIT(it.m_id),
                {
+                       it.m_set(this, player);
                        it.m_send(chan, this);
                });
                return true;
@@ -176,10 +177,9 @@ ENTCS_PROP(FRAGS, true, frags, ENTCS_SET_NORMAL,
                entity o = this.owner;
                FOREACH(EntCSProps, it.m_check(this, o),
                {
-                       it.m_set(this, o);
                        this.SendFlags |= BIT(it.m_id);
                });
-           setorigin(this, this.origin);  // relink
+               setorigin(this, this.origin); // relink
        }
 
        void entcs_attach(entity player)
@@ -189,11 +189,6 @@ ENTCS_PROP(FRAGS, true, frags, ENTCS_SET_NORMAL,
                setthink(e, entcs_think);
                e.nextthink = time;
                Net_LinkEntity(e, false, 0, entcs_send);
-               if (!IS_REAL_CLIENT(player)) return;
-               FOREACH_CLIENT(true, {
-                       assert(CS(it).entcs);
-                       _entcs_send(CS(it).entcs, msg_entity = player, BITS(23), MSG_ONE);
-               });
        }
 
        void entcs_detach(entity player)