]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/net.qh
Potentially fix an issue with buff times and vehicle entering/exiting
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / net.qh
index 3daa1cede585acd12b5d982afa396635e03d2281..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); }
@@ -30,7 +31,7 @@
                if (dt)
                {
                        e.nextthink = time + dt;
-                       e.think = SUB_Remove;
+                       e.think = SUB_Remove_self;
                }
        }
 
 
 #ifdef CSQC
        #define REGISTER_NET_LINKED(id) \
-               [[accumulate]] NET_HANDLE(id, bool) \
+               [[accumulate]] NET_HANDLE(id, bool isnew) \
                { \
                        this = self; \
                        this.sourceLocFile = __FILE__; \
                        this.sourceLocLine = __LINE__; \
+                       if (!this) isnew = true; \
                } \
                REGISTER(LinkedEntities, NET, id, m_id, new(net_linked_packet)) \
                { \
 REGISTRY(LinkedEntities, BITS(8) - 1)
 #define LinkedEntities_from(i) _LinkedEntities_from(i, NULL)
 REGISTER_REGISTRY(LinkedEntities)
-REGISTRY_SORT(LinkedEntities, 0)
+REGISTRY_SORT(LinkedEntities)
 REGISTRY_CHECK(LinkedEntities)
 STATIC_INIT(RegisterLinkedEntities_renumber)
 {
@@ -141,7 +143,7 @@ STATIC_INIT(RegisterLinkedEntities_renumber)
 REGISTRY(TempEntities, BITS(8) - 80)
 #define TempEntities_from(i) _TempEntities_from(i, NULL)
 REGISTER_REGISTRY(TempEntities)
-REGISTRY_SORT(TempEntities, 0)
+REGISTRY_SORT(TempEntities)
 REGISTRY_CHECK(TempEntities)
 STATIC_INIT(RegisterTempEntities_renumber)
 {