]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branches 'TimePath/oo', 'TimePath/buffsys', 'TimePath/gametypesys'
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 14 Aug 2015 03:53:32 +0000 (13:53 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 14 Aug 2015 03:54:12 +0000 (13:54 +1000)
19 files changed:
qcsrc/client/main.qc
qcsrc/client/progs.src
qcsrc/common/buffs.qh
qcsrc/common/items/all.qh
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/monsters/all.qh
qcsrc/common/nades.qh
qcsrc/common/oo.qh
qcsrc/common/registry.qh
qcsrc/common/util-post.qh [new file with mode: 0644]
qcsrc/common/util-pre.qh
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/menudefs.qh
qcsrc/dpdefs/progsdefs.qh
qcsrc/menu/menu.qc
qcsrc/menu/progs.src
qcsrc/server/g_world.qc
qcsrc/server/progs.src

index 276b5e32bd663e233068e2a067d1a57127768a93..b56887878d392b9651ed518a19d3f4f2f8f65135 100644 (file)
@@ -142,8 +142,6 @@ void CSQC_Init(void)
        // needs to be done so early because of the constants they create
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
-       CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
-       CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
index 94c92a54c16553e270e7f972591a9136c8071a62..d161c6dfc60b09ff502b2cfa4bb24c313ade789d 100644 (file)
@@ -2,6 +2,7 @@
 
 ../common/util-pre.qh
 ../dpdefs/csprogsdefs.qh
+../common/util-post.qh
 
 announcer.qc
 bgmscript.qc
index 7396f974c2bc5eb1ebacdbfdc31bb7a9586d3479..db57943241b9c3d0b0bad9698dfd9f0e76dd1c5d 100644 (file)
 
 void RegisterBuffs();
 const int BUFFS_MAX = 16;
-entity BUFFS[BUFFS_MAX];
+entity BUFFS[BUFFS_MAX], BUFFS_first, BUFFS_last;
 int BUFFS_COUNT;
 #define REGISTER_BUFF(id) \
-    REGISTER(RegisterBuffs, BUFF, BUFFS, BUFFS_COUNT, id, Buff, m_id); \
+    REGISTER(RegisterBuffs, BUFF, BUFFS, BUFFS_COUNT, id, m_id, NEW(Buff)); \
     REGISTER_INIT_POST(BUFF, id) { \
         this.netname = this.m_name; \
         this.m_itemid = BIT(this.m_id - 1); \
index 372e3ff69c1a02dd9f0967ab8a82f69ea84d1eaa..e22bcd7477c3e8e2ea534f65deb1c20430c1502f 100644 (file)
@@ -5,10 +5,10 @@
 
 void RegisterItems();
 const int MAX_ITEMS = 24;
-entity ITEMS[MAX_ITEMS];
+entity ITEMS[MAX_ITEMS], ITEMS_first, ITEMS_last;
 int ITEM_COUNT;
 /** If you register a new item, make sure to add it to all.inc */
-#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, ITEMS, ITEM_COUNT, id, class, m_id)
+#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, ITEMS, ITEM_COUNT, id, m_id, NEW(class))
 REGISTER_REGISTRY(RegisterItems)
 
 void Dump_Items();
index 55165a12c2efa02fe371e683c49b0a89f18e5d15..33af1b3900ddf163bc14dd0844e6f03bcb9aec4b 100644 (file)
@@ -603,7 +603,7 @@ void _MapInfo_Map_ApplyGametype(string s, int pWantedType, int pThisType, int lo
 string _MapInfo_GetDefaultEx(float t)
 {
        entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.items)
                        return e.model2;
        return "";
@@ -612,7 +612,7 @@ string _MapInfo_GetDefaultEx(float t)
 float _MapInfo_GetTeamPlayBool(float t)
 {
        entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.items)
                        return e.team;
        return false;
@@ -754,7 +754,7 @@ float MapInfo_Type_FromString(string t)
        }
        if(t == "all")
                return MAPINFO_TYPE_ALL;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.mdl)
                        return e.items;
        return 0;
@@ -763,7 +763,7 @@ float MapInfo_Type_FromString(string t)
 string MapInfo_Type_Description(float t)
 {
        entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.items)
                        return e.gametype_description;
        return "";
@@ -774,7 +774,7 @@ string MapInfo_Type_ToString(float t)
        entity e;
        if(t == MAPINFO_TYPE_ALL)
                return "all";
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.items)
                        return e.mdl;
        return "";
@@ -783,7 +783,7 @@ string MapInfo_Type_ToString(float t)
 string MapInfo_Type_ToText(float t)
 {
        entity e;
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(t == e.items)
                        return e.message;
        /* xgettext:no-c-format */
@@ -1166,7 +1166,13 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                else if(t == "cdtrack")
                {
                        t = car(s); s = cdr(s);
-                       if(pGametypeToSet) // FIXME is this check right here?
+                       // We do this only if pGametypeToSet even though this
+                       // content is theoretically game type independent,
+                       // because MapInfo_Map_clientstuff contains otherwise
+                       // game type dependent stuff. That way this value stays
+                       // empty when not setting a game type to not set any
+                       // false expectations.
+                       if(pGametypeToSet)
                        {
                                if (!cvar_value_issafe(t))
                                        print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
@@ -1285,7 +1291,7 @@ int MapInfo_CurrentGametype()
 {
        entity e;
        int prev = cvar("gamecfg");
-       for(e = MapInfo_Type_first; e; e = e.enemy)
+       for(e = MAPINFO_TYPES_first; e; e = e.enemy)
                if(cvar(e.netname))
                        if(prev != e.items)
                                return e.items;
@@ -1315,7 +1321,7 @@ float MapInfo_CheckMap(string s) // returns 0 if the map can't be played with th
 
 void MapInfo_SwitchGameType(int t)
 {
-       for (entity e = MapInfo_Type_first; e; e = e.enemy) {
+       for (entity e = MAPINFO_TYPES_first; e; e = e.enemy) {
                cvar_set(e.netname, (t == e.items) ? "1" : "0");
        }
 }
index 3038cce60e70a0ebe8380f2c47f350a779a151ba..22b17d900de78e4e4fb451363d27fd29360e00c8 100644 (file)
@@ -3,44 +3,54 @@
 
 #include "util.qh"
 
+CLASS(Gametype, Object)
+    ATTRIB(Gametype, m_id, int, 0)
+    /** game type ID */
+    ATTRIB(Gametype, items, int, 0)
+    /** game type name as in cvar (with g_ prefix) */
+    ATTRIB(Gametype, netname, string, string_null)
+    /** game type short name */
+    ATTRIB(Gametype, mdl, string, string_null)
+    /** human readable name */
+    ATTRIB(Gametype, message, string, string_null)
+    /** does this gametype support teamplay? */
+    ATTRIB(Gametype, team, bool, false)
+    /** game type defaults */
+    ATTRIB(Gametype, model2, string, string_null)
+    /** game type description */
+    ATTRIB(Gametype, gametype_description, string, string_null)
+    CONSTRUCTOR(Gametype, string hname, string sname, string g_name, bool gteamplay, string defaults, string gdescription)
+    {
+        CONSTRUCT(Gametype);
+        this.netname = g_name;
+        this.mdl = sname;
+        this.message = hname;
+        this.team = gteamplay;
+        this.model2 = defaults;
+        this.gametype_description = gdescription;
+        return this;
+    }
+ENDCLASS(Gametype)
+
+void RegisterGametypes();
+const int MAX_MAPINFO_TYPES = 24;
+entity MAPINFO_TYPES[MAX_MAPINFO_TYPES], MAPINFO_TYPES_first, MAPINFO_TYPES_last;
+int MAPINFO_TYPE_COUNT;
 int MAPINFO_TYPE_ALL;
-entity MapInfo_Type_first;
-entity MapInfo_Type_last;
-.entity enemy; // internal next pointer
-
-.int items; // game type ID
-.string netname; // game type name as in cvar (with g_ prefix)
-.string mdl; // game type short name
-.string message; // human readable name
-.int team; // does this gametype support teamplay?
-.string model2; // game type defaults
-.string gametype_description; // game type description
-
-#define REGISTER_GAMETYPE(hname,sname,g_name,NAME,gteamplay,defaults,gdescription) \
-       int MAPINFO_TYPE_##NAME; \
-       entity MapInfo_Type##g_name; \
-       void RegisterGametypes_##g_name() \
-       { \
-               MAPINFO_TYPE_##NAME = MAPINFO_TYPE_ALL + 1; \
-               MAPINFO_TYPE_ALL |= MAPINFO_TYPE_##NAME; \
-               MapInfo_Type##g_name = spawn(); \
-               MapInfo_Type##g_name.items = MAPINFO_TYPE_##NAME; \
-               MapInfo_Type##g_name.netname = #g_name; \
-               MapInfo_Type##g_name.mdl = #sname; \
-               MapInfo_Type##g_name.message = hname; \
-               MapInfo_Type##g_name.team = gteamplay; \
-               MapInfo_Type##g_name.model2 = defaults; \
-               MapInfo_Type##g_name.gametype_description = gdescription; \
-               if(!MapInfo_Type_first) \
-                       MapInfo_Type_first = MapInfo_Type##g_name; \
-               if(MapInfo_Type_last) \
-                       MapInfo_Type_last.enemy = MapInfo_Type##g_name; \
-               MapInfo_Type_last = MapInfo_Type##g_name; \
-       } \
-       ACCUMULATE_FUNCTION(RegisterGametypes, RegisterGametypes_##g_name)
+
+#define REGISTER_GAMETYPE(hname, sname, g_name, NAME, gteamplay, defaults, gdescription)                    \
+    int MAPINFO_TYPE_##NAME;                                                                                \
+    REGISTER(RegisterGametypes, MAPINFO_TYPE, MAPINFO_TYPES, MAPINFO_TYPE_COUNT, g_name, m_id,              \
+        NEW(Gametype, hname, #sname, #g_name, gteamplay, defaults, gdescription)                            \
+    ) {                                                                                                     \
+        /* same as `1 << m_id` */                                                                           \
+        MAPINFO_TYPE_##NAME = MAPINFO_TYPE_ALL + 1; MAPINFO_TYPE_ALL |= MAPINFO_TYPE_##NAME;                \
+        this.items = MAPINFO_TYPE_##NAME;                                                                   \
+    }
+REGISTER_REGISTRY(RegisterGametypes)
 
 #define IS_GAMETYPE(NAME) \
-       (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
+    (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
 
 REGISTER_GAMETYPE(_("Deathmatch"),dm,g_dm,DEATHMATCH,false,"timelimit=20 pointlimit=30 leadlimit=0",_("Kill all enemies"));
 #define g_dm IS_GAMETYPE(DEATHMATCH)
index 30de42cd9f1051bfb550c140ca0ee96db1aa0848..45adf5e5906e3e0ac8988e5712ad9733a5ce1e88 100644 (file)
@@ -5,13 +5,13 @@
 
 void RegisterMonsters();
 const int MON_MAXCOUNT = 24;
-entity monster_info[MON_MAXCOUNT];
+entity monster_info[MON_MAXCOUNT], monster_info_first, monster_info_last;
 entity get_monsterinfo(float id);
 int MON_COUNT;
 const int MON_FIRST = 1;
 #define MON_LAST (MON_FIRST + MON_COUNT - 1)
 /** If you register a new monster, make sure to add it to all.inc */
-#define REGISTER_MONSTER(id, class) REGISTER(RegisterMonsters, MON, monster_info, MON_COUNT, id, class, monsterid)
+#define REGISTER_MONSTER(id, class) REGISTER(RegisterMonsters, MON, monster_info, MON_COUNT, id, monsterid, NEW(class))
 #include "monster.qh"
 #define REGISTER_MONSTER_SIMPLE(id, monsterflags, min_s, max_s, modelname, shortname, mname) \
     REGISTER_MONSTER(id, Monster) {                                     \
@@ -24,6 +24,7 @@ const int MON_FIRST = 1;
         this.model = strzone(strcat("models/monsters/", modelname));    \
     }                                                                   \
     REGISTER_INIT(MON, id)
+REGISTER_REGISTRY(RegisterMonsters)
 
 #include "../util.qh"
 
index 75495abca694da6cc4bed39cc64d8cd02dd77f46..d029da43ecc34add6f6ac64a5477c3fd1392d91e 100644 (file)
@@ -25,9 +25,9 @@ const int PROJECTILE_NADE_MONSTER_BURN = 83;
 
 void RegisterNades();
 const int NADES_MAX = 8;
-entity NADES[NADES_MAX];
+entity NADES[NADES_MAX], NADES_first, NADES_last;
 int NADES_COUNT;
-#define REGISTER_NADE(id) REGISTER(RegisterNades, NADE_TYPE, NADES, NADES_COUNT, id, Nade, m_id)
+#define REGISTER_NADE(id) REGISTER(RegisterNades, NADE_TYPE, NADES, NADES_COUNT, id, m_id, NEW(Nade))
 REGISTER_REGISTRY(RegisterNades)
 
 CLASS(Nade, Object)
index 63b17089e48c0a8d080e30b797f46b689fd4385f..aa660ab15d96de375fd87d11c374d6088840ec48 100644 (file)
 #ifndef OO_H
 #define OO_H
 
+#include "registry.qh"
+
 #ifdef MENUQC
-       #define NULL (null_entity)
+    #define NULL (null_entity)
 #else
-       #define NULL (world)
+    #define NULL (world)
 #endif
 
 .string classname;
-.string vtblname;
-.entity vtblbase;
-entity spawnVtbl(entity this, entity base)
-{
-       entity vtbl = spawn();
-       copyentity(this, vtbl);
-       vtbl.vtblname = vtbl.classname;
-       vtbl.classname = "vtbl";
-       vtbl.vtblbase = base ? base : vtbl; // Top level objects use vtbl as base
-       return vtbl;
+/** Location entity was spawned from in source */
+.string sourceLocFile;
+.int sourceLocLine;
+entity _spawn();
+entity __spawn(string _classname, string _sourceFile, int _sourceLine) {
+    entity this = _spawn();
+    this.classname = _classname;
+    this.sourceLocFile = _sourceFile;
+    this.sourceLocLine = _sourceLine;
+    return this;
 }
 
-entity Object_vtbl;
-entity spawnObject(entity this, entity)
-{
-       this = spawn();
-       this.classname = "Object";
-       if (!Object_vtbl) Object_vtbl = spawnVtbl(this, NULL);
-       return this;
-}
 
-// Classes have a `spawn##cname(entity, entity)` constructor
-// The parameters are used as locals for [[accumulate]]
+
+#define entityclass(...) OVERLOAD(entityclass, __VA_ARGS__)
+#define entityclass_1(name) entityclass_2(name, Object)
+#ifndef QCC_SUPPORT_ENTITYCLASS
+    #define entityclass_2(name, base) typedef entity name
+    #define class(name)
+    #define new(class) __spawn(#class, __FILE__, __LINE__)
+#else
+    #define entityclass_2(name, base) entityclass name : base {}
+    #define class(name) [[class(name)]]
+    #define new(class) ((class) __spawn(#class, __FILE__, __LINE__))
+#endif
+
+// Classes have a `spawn##cname(entity)` constructor
+// The parameter is used across [[accumulate]] functions
 
 // Macro to hide this implementation detail
-#define NEW(cname) (spawn##cname(NULL, NULL))
+#define NEW(cname, ...) \
+    OVERLOAD(spawn##cname, new(cname), ##__VA_ARGS__)
 
-#define CLASS(cname, base)                                                     \
-entity spawn##cname(entity this, entity basevtbl) {                            \
-    this = NEW(base); basevtbl = base##_vtbl;                                  \
-}
+#define CONSTRUCT(cname, ...) \
+    OVERLOAD(spawn##cname, this, ##__VA_ARGS__)
 
-#define METHOD(cname, name, prototype)                                         \
-prototype cname##_##name;                                                      \
-.prototype name;                                                               \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {             \
-    this.name = cname##_##name;                                                \
-}
+#define CONSTRUCTOR(cname, ...) \
+    cname OVERLOAD(spawn##cname, cname this, __VA_ARGS__)
 
-#define ATTRIB(cname, name, type, val)                                         \
-.type name;                                                                    \
-[[accumulate]] entity spawn##cname(entity this, entity basevtbl) {             \
-    this.name = val;                                                           \
-}
+.string vtblname;
+.entity vtblbase;
 
-#define ATTRIBARRAY(cname, name, type, cnt)                                    \
-.type name[cnt];
-
-#define ENDCLASS(cname)                                                        \
-.bool instanceOf##cname;                                                       \
-entity cname##_vtbl;                                                           \
-[[accumulate]] [[last]] entity spawn##cname(entity this, entity basevtbl) {    \
-    this.instanceOf##cname = true;                                             \
-    this.classname = #cname;                                                   \
-    if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl);               \
-    return this;                                                               \
-}
+void RegisterClasses() { }
+ACCUMULATE_FUNCTION(__static_init, RegisterClasses)
+
+#define VTBL(cname, base) \
+    INIT_STATIC(cname); \
+    entity cname##_vtbl; \
+    void cname##_vtbl_init() { \
+        cname e = new(vtbl); \
+        spawn##cname##_static(e); \
+        e.vtblname = #cname; \
+        /* Top level objects refer to themselves */ \
+        e.vtblbase = base##_vtbl ? base##_vtbl : e; \
+        cname##_vtbl = e; \
+    } \
+    ACCUMULATE_FUNCTION(RegisterClasses, cname##_vtbl_init)
+
+#define INIT_STATIC(cname) [[accumulate]] void spawn##cname##_static(cname this)
+#define INIT(cname) [[accumulate]] cname spawn##cname##_1(cname this)
+
+#define CLASS(cname, base)                  \
+    entityclass(cname, base);               \
+    class(cname) .bool instanceOf##cname;   \
+    VTBL(cname, base)                       \
+    INIT_STATIC(cname) {                    \
+        if (cname##_vtbl) {                 \
+            copyentity(cname##_vtbl, this); \
+            return;                         \
+        }                                   \
+        spawn##base##_static(this);         \
+        this.instanceOf##cname = true;      \
+    }                                       \
+    INIT(cname) {                           \
+        /* Only statically initialize the current class, it contains everything it inherits */ \
+        if (cname##_vtbl.vtblname == this.classname) { \
+            spawn##cname##_static(this);    \
+            this.classname = #cname;        \
+            this.vtblname = string_null;    \
+            this.vtblbase = cname##_vtbl;   \
+        }                                   \
+        spawn##base##_1(this);              \
+    }
+
+#define METHOD(cname, name, prototype)      \
+    class(cname) .prototype name;           \
+    prototype cname##_##name;               \
+    INIT_STATIC(cname) { this.name = cname##_##name; }
+
+#define ATTRIB(cname, name, type, val)      \
+    class(cname) .type name;                \
+    INIT(cname) { this.name = val; }
+
+#define ATTRIBARRAY(cname, name, type, cnt) \
+    class(cname) .type name[cnt];
+
+#define ENDCLASS(cname) \
+    [[last]] INIT(cname) { return this; }
 
 #define SUPER(cname) (cname##_vtbl.vtblbase)
 
+#define spawn_static(this)
+#define spawn_1(this)
+#define _vtbl NULL
+CLASS(Object, ); ENDCLASS(Object)
+#undef spawn_static
+#undef spawn_1
+#undef _vtbl
+
 #endif
index 3bf8f40992325a8c90873b5fe64c9ac20518eadc..6e8557edfd8808a10c0426e6c102d1f1c1304a98 100644 (file)
@@ -2,19 +2,24 @@
 #define REGISTRY_H
 
 #include "oo.qh"
+#include "util.qh"
 
 #define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
 #define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
 
-#define REGISTER(initfunc, ns, array, counter, id, class, fld)  \
+#define REGISTER(initfunc, ns, array, counter, id, fld, inst)   \
     entity ns##_##id;                                           \
     REGISTER_INIT(ns, id) { }                                   \
     REGISTER_INIT_POST(ns, id) { }                              \
+    .entity enemy; /* internal next pointer */                  \
     void Register_##ns##_##id() {                               \
-        entity this = NEW(class);                               \
+        entity this = inst;                                     \
         ns##_##id = this;                                       \
         this.fld = counter;                                     \
         array[counter++] = this;                                \
+        if (!array##_first)    array##_first = this;            \
+        if ( array##_last)     array##_last.enemy = this;       \
+        array##_last = this;                                    \
         Register_##ns##_##id##_init(this);                      \
         Register_##ns##_##id##_init_post(this);                 \
     }                                                           \
@@ -25,4 +30,9 @@ void __static_init() { }
 #define static_init() CALL_ACCUMULATED_FUNCTION(__static_init)
 #define REGISTER_REGISTRY(func) ACCUMULATE_FUNCTION(__static_init, func)
 
+#define STATIC_INIT(func) \
+    void _static_##func(); \
+    ACCUMULATE_FUNCTION(__static_init, _static_##func) \
+    void _static_##func()
+
 #endif
diff --git a/qcsrc/common/util-post.qh b/qcsrc/common/util-post.qh
new file mode 100644 (file)
index 0000000..6d1ab21
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef UTIL_POST_H
+#define UTIL_POST_H
+
+#define spawn() new(entity)
+
+#include "oo.qh"
+
+#endif
index cb2ef8f80e93bd43036e4f21ff6fe053f1bf7b5e..18b46c8d321667e76d3a78896e4c9b23c3fc3c16 100644 (file)
     const int false = 0;
 #endif
 
-#ifndef QCC_SUPPORT_ENTITYCLASS
-    #define entityclass(name) typedef entity name
-    #define class(name)
-    #define new(class) spawn()
-#else
-    #define entityclass(name) entityclass name {}
-    #define class(name) [[class(name)]]
-    #define new(class) ((class) spawn())
-#endif
-
 // Transitional aliases
 [[deprecated("use true")]] [[alias("true")]] const bool TRUE;
 [[deprecated("use false")]] [[alias("false")]] const bool FALSE;
index c4d8c54ce05c4b6b847a36f54d1d6672beda0379..b10ef09baf75fadba2367fb6f5225c8bcec58b90 100644 (file)
@@ -8,6 +8,8 @@
 #define TRUE _TRUE
 #define FALSE _FALSE
 
+#define spawn _spawn
+
 #include "upstream/csprogsdefs.qc"
 
 #undef true
@@ -15,6 +17,8 @@
 #undef TRUE
 #undef FALSE
 
+#undef spawn
+
 #pragma noref 0
 
 #endif
index dce99cde598cbba758d4c3cb36fdc3db325a66ba..7d4dcc6af589598f1fa5abd72f5f29c4dee8790e 100644 (file)
@@ -8,6 +8,8 @@
 #define TRUE _TRUE
 #define FALSE _FALSE
 
+#define spawn _spawn
+
 #include "upstream/menudefs.qc"
 
 #undef true
@@ -15,6 +17,8 @@
 #undef TRUE
 #undef FALSE
 
+#undef spawn
+
 int(string str, string sub, int startpos) _strstrofs = #221;
 #define strstrofs _strstrofs
 int(string str, int ofs) _str2chr = #222;
index bffacafddc59a928ac76441e89fe284579bb173a..c2440d3dabffba98aaf3a1324d321267a224dd46 100644 (file)
@@ -8,6 +8,8 @@
 #define TRUE _TRUE
 #define FALSE _FALSE
 
+#define spawn _spawn
+
 #include "upstream/progsdefs.qc"
 
 #undef true
@@ -15,6 +17,8 @@
 #undef TRUE
 #undef FALSE
 
+#undef spawn
+
 #pragma noref 0
 
 #endif
index b0146349f756adbc24ff3842cdae1e345de1cc20..b2a85093c6ecc21a5258692ac5df1db8fa1c4ccc 100644 (file)
@@ -82,7 +82,6 @@ void m_init()
        // needs to be done so early because of the constants they create
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
-       CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
 
        RegisterSLCategories();
 
index 2315616d1701bfc29dbdbe8cc7c6ce04e8433092..a35fd484f37c1263172229728da7d2672520ee40 100644 (file)
@@ -3,6 +3,7 @@
 ../common/util-pre.qh
 ../dpdefs/menudefs.qh
 ../dpdefs/keycodes.qh
+../common/util-post.qh
 
 oo/classes.qc
 
index 27db2b4fd90d7b3ad7d0c4c2c81f7be658763056..881f8f071915aef1eaa5428cab0b143bca65b953 100644 (file)
@@ -561,8 +561,6 @@ void spawnfunc___init_dedicated_server(void)
        // needs to be done so early because of the constants they create
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
-       CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
-       CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
@@ -611,8 +609,6 @@ void spawnfunc_worldspawn (void)
        // needs to be done so early because of the constants they create
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
-       CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
-       CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
index 2d110d2f9fe273f3b2fca89bd3c582da92ac391e..388d1b675486fd8e0d1e21fb5db53343a0534682 100644 (file)
@@ -5,6 +5,7 @@ sys-pre.qh
 ../dpdefs/progsdefs.qh
 ../dpdefs/dpextensions.qh
 sys-post.qh
+../common/util-post.qh
 
 anticheat.qc
 antilag.qc