]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qc
Fix typo
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qc
index 36b8b587edea078fec656450ba5bb8acd1259383..a641905c4ef06018bcf9391ffde994fd90a3b3e6 100644 (file)
@@ -35,7 +35,7 @@ STATIC_INIT(RegisterEntCSProps_renumber) { FOREACH(EntCSProps, true, it.m_id = i
 
 #define ENTCS_PROP_CODED(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
        bool id##_check(entity ent, entity player) { \
-               return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop)) * decfactor); \
+               return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop)) / decfactor); \
        } \
        _ENTCS_PROP(id, ispublic, checkprop, setprop, svsend, clreceive)
 
@@ -88,7 +88,7 @@ ENTCS_PROP(ORIGIN, false, origin, ENTCS_SET_NORMAL,
        { WriteVector(chan, ent.origin); },
        { ent.has_sv_origin = true; vector v = ReadVector(); setorigin(ent, v); })
 
-#define DEC_FACTOR (360 / 256)
+#define DEC_FACTOR (360 / 32)
 ENTCS_PROP_CODED(ANGLES, false, angles_y, ENTCS_SET_NORMAL, DEC_FACTOR,
        { WriteByte(chan, ent.angles.y / DEC_FACTOR); },
        { vector v = '0 0 0'; v.y = ReadByte() * DEC_FACTOR; ent.angles = v; })
@@ -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)