Browse Source

engine: restore lumps after swapping them for blue shift maps

Mod_TestBmodelLumps may modify srclumps data, which is essential for
brush model loader. BlueShift maps have swapped lumps for some reason
Restoring them to default is fix for now
pull/2/head
Alibek Omarov 3 years ago
parent
commit
0963e05716
  1. 19
      engine/common/mod_bmodel.c

19
engine/common/mod_bmodel.c

@ -2908,14 +2908,29 @@ qboolean Mod_TestBmodelLumps( const char *name, const byte *mod_base, qboolean s
break; break;
} }
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++ )

Loading…
Cancel
Save