engine: swap lumps back after they were swapped for blue-shift maps

This commit is contained in:
Alibek Omarov 2021-11-29 16:28:42 +03:00
parent ecddae8ee6
commit 24edcf7d9e

View File

@ -2780,14 +2780,29 @@ qboolean Mod_LoadBmodelLumps( const byte *mod_base, qboolean isworld )
if( isworld ) world.flags = 0; // clear world settings if( isworld ) world.flags = 0; // clear world settings
bmod->isworld = isworld; bmod->isworld = isworld;
if( header->version == HLBSP_VERSION && if( header->version == HLBSP_VERSION )
header->lumps[LUMP_ENTITIES].fileofs <= 1024 && {
// only relevant for half-life maps
if( header->lumps[LUMP_ENTITIES].fileofs <= 1024 &&
(header->lumps[LUMP_ENTITIES].filelen % sizeof( dplane_t )) == 0 ) (header->lumps[LUMP_ENTITIES].filelen % sizeof( dplane_t )) == 0 )
{ {
// blue-shift swapped lumps // blue-shift swapped lumps
srclumps[0].lumpnumber = LUMP_PLANES; srclumps[0].lumpnumber = LUMP_PLANES;
srclumps[1].lumpnumber = LUMP_ENTITIES; 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 // loading base lumps
for( i = 0; i < ARRAYSIZE( srclumps ); i++ ) for( i = 0; i < ARRAYSIZE( srclumps ); i++ )