]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
spawnfuncs: hide original .classname
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 1 Sep 2017 08:34:06 +0000 (18:34 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 1 Sep 2017 09:53:55 +0000 (19:53 +1000)
qcsrc/lib/spawnfunc.qh

index 3434d39982402679f5925fa27121b4ba89846a97..e30e565fd3259a6916d36d5c230d7165bae4dd1c 100644 (file)
@@ -33,14 +33,20 @@ noref bool require_spawnfunc_prefix;
 
     .void(entity) __spawnfunc_constructor;
     noref IntrusiveList g_spawn_queue;
-    .string targetname, __spawnfunc_targetname;
+
     #define SPAWNFUNC_INTERNAL_FIELDS(X) \
-        X(targetname, string_null) \
+        X(string, classname, "spawnfunc") \
+        X(string, targetname, string_null) \
         /**/
+
+    #define X(T, fld, def) .T fld, __spawnfunc_##fld;
+    SPAWNFUNC_INTERNAL_FIELDS(X)
+    #undef X
+
     void __spawnfunc_defer(entity prototype, void(entity) constructor)
     {
         IL_PUSH(g_spawn_queue, prototype);
-        #define X(fld, def) { prototype.__spawnfunc_##fld = prototype.fld; prototype.fld = def; }
+        #define X(T, fld, def) { prototype.__spawnfunc_##fld = prototype.fld; prototype.fld = def; }
         SPAWNFUNC_INTERNAL_FIELDS(X);
         #undef X
         prototype.__spawnfunc_constructor = constructor;
@@ -57,7 +63,7 @@ noref bool require_spawnfunc_prefix;
         entity e = new(clone);
         copyentity(prototype, e);
         IL_PUSH(g_map_entities, e);
-        #define X(fld, def) { e.fld = e.__spawnfunc_##fld; e.__spawnfunc_##fld = def; }
+        #define X(T, fld, def) { e.fld = e.__spawnfunc_##fld; e.__spawnfunc_##fld = def; }
         SPAWNFUNC_INTERNAL_FIELDS(X);
         #undef X
         e.__spawnfunc_constructor(e);