From 3da10f28c496cf553528a8864bd944d7a6a9ea29 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 2 Dec 2019 02:14:02 +0300 Subject: [PATCH] engine: restored BShift maps support --- engine/common/mod_bmodel.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 2d6a6e3b..a8f655d1 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -162,7 +162,7 @@ typedef struct typedef struct { - const int lumpnumber; + int lumpnumber; const size_t mincount; const size_t maxcount; const int entrysize; @@ -2780,6 +2780,15 @@ 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 ) + { + // blue-shift swapped lumps + srclumps[0].lumpnumber = LUMP_PLANES; + srclumps[1].lumpnumber = LUMP_ENTITIES; + } + // loading base lumps for( i = 0; i < ARRAYSIZE( srclumps ); i++ ) Mod_LoadLump( mod_base, &srclumps[i], &worldstats[i], isworld ? (LUMP_SAVESTATS|LUMP_SILENT) : 0 );