Skip to content
Permalink
Browse files

- added check for multiple parsing of the same MAPINFO

Warning message is issued when such case is detected
  • Loading branch information...
alexey-lysiuk committed Aug 17, 2019
1 parent a5e10fd commit c95a555f5e099fad0189bb188ed89615736da2bb
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/gamedata/g_mapinfo.cpp
@@ -62,6 +62,8 @@ TArray<FEpisode> AllEpisodes;

extern TMap<int, FString> HexenMusic;

TArray<int> 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();
}

//==========================================================================

1 comment on commit c95a555

@Nemrtvi

This comment has been minimized.

Copy link
Contributor

Nemrtvi commented on c95a555 Aug 18, 2019

MAPINFO file is processed more --> than <-- once. Not "that".

Please sign in to comment.
You can’t perform that action at this time.