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 68b5d0b..c9d6c5e 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)