From b9eb6d869895de454155ebbd2da5ca1e5c1f8727 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 18 Sep 2025 16:40:51 +0200 Subject: [PATCH] simplify startup map checks a little --- src/d_main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index f1fda7f21..4a430fd22 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1922,12 +1922,9 @@ void D_SRB2Main(void) { name = lumpinfo->name; - if (memcmp(name, "MAP", 3) == 0) // Ignore the headers + if (memcmp(name, "MAP", 3) == 0 && name[5] == '\0') // Ignore the headers { - INT16 num; - if (name[5] != '\0') - continue; - num = (INT16)M_MapNumber(name[3], name[4]); + INT16 num = (INT16)M_MapNumber(name[3], name[4]); // we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant if (num <= NUMMAPS && mapheaderinfo[num - 1]) @@ -1953,12 +1950,9 @@ void D_SRB2Main(void) { name = lumpinfo->name; - if (memcmp(name, "MAP", 3) == 0) // Ignore the headers + if (memcmp(name, "MAP", 3) == 0 && name[5] == '\0') // Ignore the headers { - INT16 num; - if (name[5] != '\0') - continue; - num = (INT16)M_MapNumber(name[3], name[4]); + INT16 num = (INT16)M_MapNumber(name[3], name[4]); // we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant if (num <= NUMMAPS && mapheaderinfo[num - 1])