]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/spawnfunc.qh
Merge branch 'TimePath/globalforces' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / spawnfunc.qh
index 22047bbc9daac0d285478015cbecbcf14ceb6303..ae6db507f82b527babf8cb1bd49239b5df812a4b 100644 (file)
@@ -20,13 +20,14 @@ 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;
 
@@ -35,11 +36,12 @@ noref bool require_spawnfunc_prefix;
                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; \
                        } \
@@ -142,6 +144,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) \