]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Renumber gametypes after sorting their IDs, fixes sending of gametypes defined outsid...
authorMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 10:59:52 +0000 (20:59 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 10:59:52 +0000 (20:59 +1000)
qcsrc/common/mapinfo.qh

index 68b5d0b3b888addd754d9e074b21b04dbef4d9c9..c9d6c5e722449773a850188a4f02d9d4e7276d07 100644 (file)
@@ -119,6 +119,7 @@ REGISTRY_SORT(Gametypes);
 REGISTRY_CHECK(Gametypes)
 
 REGISTRY_DEFINE_GET(Gametypes, NULL)
+STATIC_INIT(Gametypes_renumber) { FOREACH(Gametypes, true, it.m_id = i); }
 #define REGISTER_GAMETYPE(NAME, inst) REGISTER(Gametypes, MAPINFO_TYPE, NAME, m_id, inst)
 
 #define IS_GAMETYPE(NAME) (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)