]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/spawnfunc.qh
Whitelist max_health (used by trigger_heal)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / spawnfunc.qh
index 0c076a2241b43bb03aa7563f127c4c86db4fd514..e2a25cbc76ef3ec1b8e2f674b1793f0d2eccc744 100644 (file)
@@ -1,5 +1,8 @@
 #pragma once
 
+// remove this ifdef when client or menu will actually make use of this stuff
+#ifdef SVQC
+
 /** If this global exists, only functions with spawnfunc_ name prefix qualify as spawn functions */
 noref bool require_spawnfunc_prefix;
 .bool spawnfunc_checked;
@@ -151,6 +154,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, lodmodel1) \
                FIELD_SCALAR(fld, ltime) \
                FIELD_SCALAR(fld, map) \
+               FIELD_SCALAR(fld, max_health) \
                FIELD_SCALAR(fld, mdl) \
                FIELD_SCALAR(fld, message2) \
                FIELD_SCALAR(fld, message) \
@@ -221,6 +225,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_VEC(fld, velocity) \
                /**/
 
+ERASEABLE
 void _checkWhitelisted(entity this, string id)
 {
        for (int i = 0, n = numentityfields(); i < n; ++i)
@@ -260,7 +265,7 @@ noref bool __spawnfunc_first;
                        assert(this); \
                } \
                if (!this.sourceLoc) { \
-                       this.sourceLoc = __FILE__ ":" STR(__LINE__); \
+                       this.sourceLoc = __FILE__":"STR(__LINE__); \
                } \
                if (!this.spawnfunc_checked) { \
                        _checkWhitelisted(this, #id); \
@@ -277,3 +282,5 @@ noref bool __spawnfunc_first;
                if (__spawnfunc_unreachable_workaround) return; \
        } \
        void __spawnfunc_##id(entity this)
+
+#endif