From 24edcf7d9e7e2f8a2c724306ae6692d5f7d69768 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 29 Nov 2021 16:28:42 +0300 Subject: [PATCH] engine: swap lumps back after they were swapped for blue-shift maps --- engine/common/mod_bmodel.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index eda98786..7b9c761d 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -2780,13 +2780,28 @@ qboolean Mod_LoadBmodelLumps( const byte *mod_base, qboolean isworld ) if( isworld ) world.flags = 0; // clear world settings bmod->isworld = isworld; - if( header->version == HLBSP_VERSION && - header->lumps[LUMP_ENTITIES].fileofs <= 1024 && - (header->lumps[LUMP_ENTITIES].filelen % sizeof( dplane_t )) == 0 ) + if( header->version == HLBSP_VERSION ) { - // blue-shift swapped lumps - srclumps[0].lumpnumber = LUMP_PLANES; - srclumps[1].lumpnumber = LUMP_ENTITIES; + // only relevant for half-life maps + if( header->lumps[LUMP_ENTITIES].fileofs <= 1024 && + (header->lumps[LUMP_ENTITIES].filelen % sizeof( dplane_t )) == 0 ) + { + // blue-shift swapped lumps + srclumps[0].lumpnumber = LUMP_PLANES; + srclumps[1].lumpnumber = LUMP_ENTITIES; + } + else + { + // everything else + srclumps[0].lumpnumber = LUMP_ENTITIES; + srclumps[1].lumpnumber = LUMP_PLANES; + } + } + else + { + // everything else + srclumps[0].lumpnumber = LUMP_ENTITIES; + srclumps[1].lumpnumber = LUMP_PLANES; } // loading base lumps