]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/spawnfunc.qh
Merge branch 'martin-t/units' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / spawnfunc.qh
index f9c056fbd3ab81e30321f673010bd2da0db064b9..e0605c93840599e8f928f359ce1f6b02cccd7016 100644 (file)
@@ -20,26 +20,28 @@ noref bool require_spawnfunc_prefix;
 
        #define _spawnfunc_checktypes(fld) \
                if (fieldname == #fld) \
-                       if (!entityfieldassignablefromeditor(i)) LOG_FATALF("Entity field '%s' cannot be whitelisted\n", fieldname);
+                       if (!entityfieldassignablefromeditor(i)) LOG_FATALF("Entity field '%s' cannot be whitelisted", fieldname);
 #else
        #define _spawnfunc_checktypes(fld)
 #endif
        #define _spawnfunc_check(fld) \
                if (fieldname == #fld) continue;
 
+       noref bool __spawnfunc_expecting;
        noref entity __spawnfunc_expect;
-       bool __spawnfunc_unreachable_workaround = true;
+       noref bool __spawnfunc_unreachable_workaround = true;
 
        #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION)
        #define spawnfunc_2(id, whitelist) \
                void __spawnfunc_##id(entity this); \
                [[accumulate]] void spawnfunc_##id(entity this) \
                { \
-                       if (self == __spawnfunc_expect) \
+                       if (__spawnfunc_expecting) \
                        { \
                                /* engine call */ \
+                               __spawnfunc_expecting = false; \
+                               this = __spawnfunc_expect; \
                                __spawnfunc_expect = NULL; \
-                               this = self; \
                        } \
                        else \
                        { \
@@ -60,7 +62,7 @@ noref bool require_spawnfunc_prefix;
                                        if (fieldname == "") continue; \
                                        FIELDS_COMMON(_spawnfunc_check) \
                                        whitelist(_spawnfunc_check) \
-                                       LOG_WARNINGF(_("Entity field %s.%s (%s) is not whitelisted. If you believe this is an error, please file an issue.\n"), #id, fieldname, value); \
+                                       LOG_WARNF(_("Entity field %s.%s (%s) is not whitelisted. If you believe this is an error, please file an issue."), #id, fieldname, value); \
                                } \
                                this.spawnfunc_checked = true; \
                        } \
@@ -132,6 +134,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, loddistance1) \
                FIELD_SCALAR(fld, lodmodel1) \
                FIELD_SCALAR(fld, ltime) \
+               FIELD_SCALAR(fld, map) \
                FIELD_SCALAR(fld, mdl) \
                FIELD_SCALAR(fld, message2) \
                FIELD_SCALAR(fld, message) \
@@ -142,6 +145,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, monster_moveflags) \
                FIELD_SCALAR(fld, monster_name) \
                FIELD_SCALAR(fld, movetype) \
+               FIELD_SCALAR(fld, move_movetype) \
                FIELD_SCALAR(fld, netname) \
                FIELD_SCALAR(fld, nextthink) \
                FIELD_SCALAR(fld, noalign) \
@@ -152,6 +156,7 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, platmovetype) \
                FIELD_SCALAR(fld, race_place) \
                FIELD_SCALAR(fld, radius) \
+               FIELD_SCALAR(fld, respawntimestart) \
                FIELD_SCALAR(fld, respawntimejitter) \
                FIELD_SCALAR(fld, respawntime) \
                FIELD_SCALAR(fld, restriction) \
@@ -161,8 +166,10 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, sound1) \
                FIELD_SCALAR(fld, sounds) \
                FIELD_SCALAR(fld, spawnflags) \
+               FIELD_SCALAR(fld, spawnmob) \
                FIELD_SCALAR(fld, speed) \
                FIELD_SCALAR(fld, strength) \
+               FIELD_SCALAR(fld, style) \
                FIELD_SCALAR(fld, target2) \
                FIELD_SCALAR(fld, target3) \
                FIELD_SCALAR(fld, target4) \
@@ -179,10 +186,13 @@ noref bool require_spawnfunc_prefix;
                FIELD_SCALAR(fld, warpzone_fadeend) \
                FIELD_SCALAR(fld, warpzone_fadestart) \
                FIELD_SCALAR(fld, weapon) \
+               FIELD_SCALAR(fld, worldtype) \
                FIELD_VEC(fld, absmax) \
                FIELD_VEC(fld, absmin) \
                FIELD_VEC(fld, angles) \
                FIELD_VEC(fld, avelocity) \
+               FIELD_VEC(fld, color) \
+               FIELD_VEC(fld, mangle) \
                FIELD_VEC(fld, maxs) \
                FIELD_VEC(fld, maxs) \
                FIELD_VEC(fld, mins) \