fixed UMAPINFO's label field to allow 'clear' as argument.

This commit is contained in:
Professor Hastig 2024-10-21 10:27:35 +02:00 committed by Ricardo Luís Vaz Silva
parent 34dc204517
commit 40546420b0
2 changed files with 18 additions and 3 deletions

View file

@ -148,8 +148,22 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape, int *id24_l
}
else if (!pname.CompareNoCase("label"))
{
scanner.MustGetToken(TK_StringConst);
mape->label = scanner.String;
if (scanner.CheckToken(TK_Identifier))
{
if (!stricmp(scanner.String, "clear"))
{
mape->label = "*";
}
else
{
scanner.ScriptError("Either 'clear' or string constant expected");
}
}
else
{
scanner.MustGetToken(TK_StringConst);
mape->label = scanner.String;
}
}
else if (!pname.CompareNoCase("next"))
{

View file

@ -2266,7 +2266,8 @@ void FormatMapName(FLevelLocals *self, int cr, FString *result)
// If a label is specified, use it uncontitionally here.
if (self->info->MapLabel.IsNotEmpty())
{
*result << self->info->MapLabel << ": ";
if (self->info->MapLabel.Compare("*"))
*result << self->info->MapLabel << ": ";
}
else if (am_showmaplabel == 1 || (am_showmaplabel == 2 && !ishub))
{