]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qc
Add a hook to add new entcs networked properties in mods
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qc
index 419bbb6a15757a44f8ff102c569482dc00ff8e6a..f50f03b5f79dfa8a1cfb89e9c9f2cd2347a19268 100644 (file)
@@ -1,5 +1,8 @@
 #include "ent_cs.qh"
 
+// for use in mods
+#define ENTCS_EXTRAPROPS
+
 #define ENTCS_SET_NORMAL(var, x) MACRO_BEGIN \
        var = x; \
 MACRO_END
@@ -48,6 +51,8 @@ MACRO_END
     PROP(true, frags, ENTCS_SET_NORMAL, \
        { WriteShort(chan, ent.frags); }, \
        { ent.frags = ReadShort(); }) \
+    \
+    ENTCS_EXTRAPROPS \
     \
        /**/
 
@@ -154,6 +159,10 @@ MACRO_END
                int n = this.sv_entnum;
                entity e = entcs_receiver(n);
                entcs_receiver(n, NULL);
+               if (e.netname) strunzone(e.netname);
+               e.netname = string_null;
+               if (e.model) strunzone(e.model);
+               e.model = string_null;
                if (e != this) delete(e);
        }