From d291431cb75cf368faa0bb6f033b526a7d047cb8 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 5 Nov 2026 15:33:40 +0100 Subject: [PATCH] add checks for missing bsp lumps not sure why there werent any, the other map lumps have those, and a corrupted file may have those missing also which would just crash instead of telling you wtf is wrong --- src/p_setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_setup.c b/src/p_setup.c index 8dda12ece..4635e4ba4 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2097,6 +2097,13 @@ static void P_LoadMapBSP(const virtres_t* virt) virtlump_t* virtsegs = vres_Find(virt, "SEGS"); virtlump_t* virtnodes = vres_Find(virt, "NODES"); + if (!virtssectors) + I_Error("SSECTORS lump not found"); + if (!virtsegs) + I_Error("SEGS lump not found"); + if (!virtnodes) + I_Error("NODES lump not found"); + numsubsectors = virtssectors->size / sizeof(mapsubsector_t); numnodes = virtnodes->size / sizeof(mapnode_t); numsegs = virtsegs->size / sizeof(mapseg_t);