From: Mario Date: Sat, 18 Jul 2020 10:59:52 +0000 (+1000) Subject: Renumber gametypes after sorting their IDs, fixes sending of gametypes defined outsid... X-Git-Tag: xonotic-v0.8.5~852 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=9941c9ba8eaf0bb0ecc47a57e095ab5d38fa652b;p=xonotic%2Fxonotic-data.pk3dir.git Renumber gametypes after sorting their IDs, fixes sending of gametypes defined outside the main codebase --- diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 68b5d0b3b..c9d6c5e72 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -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)