From e75490c99d4c6aa016dbe0da9178ff649c4367c3 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 3 Dec 2019 21:05:05 +0000 Subject: [PATCH] Semi-hacky fix to R_AddSpriteDefs printing `Added -1 frames in 0 sprites`: if the start marker is equal to or beyond the end marker, none of r_things' `for (l = startlump; l < endlump; l++)` loops will run, so just assume no sprites. Simply put, `W_CheckNumForFolderStartPK3` and its `End` equivalent will never return INT16_MAX for nonexistence, and I don't want to break any assumptions elsewhere by modifying those functions directly, so this is the simplest possible fix. --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 9763648cd..3bafafaa8 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -451,7 +451,7 @@ void R_AddSpriteDefs(UINT16 wadnum) else start++; // just after S_START - if (end == INT16_MAX) + if (end == INT16_MAX || start >= end) { CONS_Debug(DBG_SETUP, "no sprites in pwad %d\n", wadnum); return;