]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qc
Add a level warp target entity to allow maps to trigger skipping ahead in a campaign...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qc
index 71052bd2b7fdbf256aaf2d034ec2490801e9657c..419bbb6a15757a44f8ff102c569482dc00ff8e6a 100644 (file)
@@ -13,9 +13,9 @@ MACRO_END
 // #define PROP(public, fld, set, sv, cl)
 #define ENTCS_NETPROPS(ent, PROP) PROP(false, sv_entnum, ENTCS_SET_NORMAL, {}, {}) /* sentinel */ \
        PROP(false, origin, ENTCS_SET_NORMAL, \
-       { WriteShort(chan, ent.origin.x);  WriteShort(chan, ent.origin.y); \
-         WriteShort(chan, ent.origin.z); }, \
-       { ent.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(ent, v); }) \
+       { WriteCoord(chan, ent.origin.x);  WriteCoord(chan, ent.origin.y); \
+         WriteCoord(chan, ent.origin.z); }, \
+       { ent.has_sv_origin = true; vector v; v.x = ReadCoord(); v.y = ReadCoord(); v.z = ReadCoord(); setorigin(ent, v); }) \
     \
        PROP(false, angles_y, ENTCS_SET_NORMAL, \
        { WriteByte(chan, ent.angles.y / 360 * 256); }, \
@@ -64,7 +64,7 @@ MACRO_END
                        i += 1; \
                }
                ENTCS_NETPROPS(this, X);
-       #undef X
+               #undef X
                if (i >= BITS(16 - 1)) LOG_FATAL("Exceeded ENTCS_NETPROPS limit");
        }
 
@@ -73,16 +73,15 @@ MACRO_END
                entity player = this.owner;
                sf |= BIT(0); // assume private
                do {
-                       if (!(IS_PLAYER(player)))
+                       if (IS_PLAYER(player))
                        {
-                               sf &= ENTCS_PUBLICMASK; // no private updates
-                               break;
+                               if (radar_showennemies) break;
+                               if (SAME_TEAM(to, player)) break;
+                               if (!(IS_PLAYER(to) || to.caplayer) && time > game_starttime) break;
                        }
-                       if (radar_showennemies) break;
-                       if (SAME_TEAM(to, player)) break;
-                       if (!(IS_PLAYER(to) || to.caplayer) && time > game_starttime) break;
                        sf &= ENTCS_PUBLICMASK; // no private updates
                } while (0);
+
                sf |= this.m_forceupdate;
                this.m_forceupdate = 0;
                if (chan == MSG_ENTITY)
@@ -99,7 +98,7 @@ MACRO_END
                        i += 1; \
                }
                ENTCS_NETPROPS(this, X);
-       #undef X
+               #undef X
                return true;
        }
 
@@ -121,7 +120,7 @@ MACRO_END
                        i += 1; \
                }
                ENTCS_NETPROPS(this, X);
-       #undef X
+               #undef X
            setorigin(this, this.origin);  // relink
        }
 
@@ -213,7 +212,7 @@ MACRO_END
                        i += 1; \
                }
                ENTCS_NETPROPS(e, X);
-       #undef X
+               #undef X
                e.iflags |= IFLAG_ORIGIN;
                InterpolateOrigin_Note(e);
                getthink(e)(e);