]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/spawnfunc.qh
Fix initialization of maxclients
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / spawnfunc.qh
index e30e565fd3259a6916d36d5c230d7165bae4dd1c..4638bca2d490544d8881d0e1507cfe048c7f7607 100644 (file)
@@ -69,11 +69,17 @@ noref bool require_spawnfunc_prefix;
         e.__spawnfunc_constructor(e);
     }
 
+       noref bool __spawnfunc_first;
+
        #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 (!__spawnfunc_first) { \
+                __spawnfunc_first = true; \
+                static_init_early(); \
+                   } \
                    bool dospawn = true; \
                    if (__spawnfunc_expecting > 1) { __spawnfunc_expecting = false; } \
                        else if (__spawnfunc_expecting) { \