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. 27
      engine/common/mod_bmodel.c

27
engine/common/mod_bmodel.c

@ -2908,13 +2908,28 @@ 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 &&
(header->lumps[LUMP_ENTITIES].filelen % sizeof( dplane_t )) == 0 )
{ {
// blue-shift swapped lumps // only relevant for half-life maps
srclumps[0].lumpnumber = LUMP_PLANES; if( header->lumps[LUMP_ENTITIES].fileofs <= 1024 &&
srclumps[1].lumpnumber = LUMP_ENTITIES; (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 // loading base lumps

Loading…
Cancel
Save