Skip to content

Commit

Permalink
fixed UMAPINFO's label field to allow 'clear' as argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
prof-hastig committed Oct 21, 2024
1 parent 34dc204 commit 4dc9a9f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/gamedata/umapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down
3 changes: 2 additions & 1 deletion src/scripting/vmthunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit 4dc9a9f

Please sign in to comment.