From 4dc9a9fae68004060aa9a1932df0eb410ad14bc1 Mon Sep 17 00:00:00 2001 From: Professor Hastig Date: Mon, 21 Oct 2024 10:27:35 +0200 Subject: [PATCH] fixed UMAPINFO's label field to allow 'clear' as argument. --- src/gamedata/umapinfo.cpp | 18 ++++++++++++++++-- src/scripting/vmthunks.cpp | 3 ++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/gamedata/umapinfo.cpp b/src/gamedata/umapinfo.cpp index 9ba72e61b40..d574bdcb95f 100644 --- a/src/gamedata/umapinfo.cpp +++ b/src/gamedata/umapinfo.cpp @@ -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")) { diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 3153a4eabcf..a0e1b22a111 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -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)) {