From c95a555f5e099fad0189bb188ed89615736da2bb Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 17 Aug 2019 11:53:29 +0300 Subject: [PATCH] - added check for multiple parsing of the same MAPINFO Warning message is issued when such case is detected --- src/gamedata/g_mapinfo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 4389d28bf..f37f63d06 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -62,6 +62,8 @@ TArray AllEpisodes; extern TMap HexenMusic; +TArray ParsedLumps(8, true); + //========================================================================== // // @@ -2201,6 +2203,15 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i defaultinfo = gamedefaults; HexenHack = false; + if (ParsedLumps.Find(lump) != ParsedLumps.Size()) + { + sc.ScriptMessage("MAPINFO file is processed more that once\n"); + } + else + { + ParsedLumps.Push(lump); + } + while (sc.GetString ()) { if (sc.Compare("include")) @@ -2385,6 +2396,7 @@ static void ClearMapinfo() DeinitIntermissions(); primaryLevel->info = nullptr; primaryLevel->F1Pic = ""; + ParsedLumps.Clear(); } //==========================================================================