From 08ba4ece8e6e7aff50417d079f95c45041989966 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 21 Jan 2020 15:11:16 -0800 Subject: [PATCH] Don't check "Too many flats in level" with P_AddLevelFlatRuntime Also moved the debug down in case anyone uses that. --- src/p_setup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 9a270d2f3..9b5b7e5c2 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -585,15 +585,11 @@ Ploadflat (levelflat_t *levelflat, const char *flatname) if (strnicmp(levelflat[i].name, flatname, 8) == 0) return i; } + + if (numlevelflats >= MAXLEVELFLATS) + I_Error("Too many flats in level\n"); } -#ifndef ZDEBUG - CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name); -#endif - - if (numlevelflats >= MAXLEVELFLATS) - I_Error("Too many flats in level\n"); - if (levelflat) levelflat += numlevelflats; else @@ -656,6 +652,10 @@ flatfound: levelflat->u.flat.baselumpnum = LUMPERROR; } +#ifndef ZDEBUG + CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name); +#endif + return ( numlevelflats++ ); }