From 6e6019db56b79c40578aba55b77000eb9599127f Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 27 Jul 2020 16:57:34 +1000 Subject: [PATCH] Store map flags as well when parsing .arena files --- qcsrc/common/mapinfo.qc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 26eb8e4b6..7efa09be6 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -793,6 +793,8 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety string stored_Map_title = ""; string stored_Map_author = ""; int stored_supportedGametypes = 0; + int stored_supportedFeatures = 0; + int stored_flags = 0; string t, s; for (;;) { @@ -840,6 +842,8 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety _MapInfo_Map_ApplyGametype ("", pGametypeToSet, it, true); }); } + MapInfo_Map_supportedFeatures = stored_supportedFeatures; + MapInfo_Map_flags = stored_flags; return true; // no need to continue through the file, we have our map! } else @@ -849,6 +853,8 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety stored_Map_title = ""; stored_Map_author = ""; stored_supportedGametypes = 0; + stored_supportedFeatures = 0; + stored_flags = 0; continue; } } @@ -891,11 +897,11 @@ bool _MapInfo_ParseArena(string arena_filename, int fh, string pFilename, Gamety else if(t == "type") { // if there is a valid gametype in this .arena file, include it in the menu - MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS; + stored_supportedFeatures |= MAPINFO_FEATURE_WEAPONS; // type in quake 3 holds all the supported gametypes, so we must loop through all of them FOREACH_WORD(s, true, { - Gametype f = MapInfo_Type_FromString(it); + Gametype f = MapInfo_Type_FromString(it, false); if(f) stored_supportedGametypes |= f.m_flags; }); -- 2.39.2