mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Move model->numleafs check to Mod_LoadLeafs
This commit is contained in:
parent
b6fe0ac31f
commit
f6ce3a447c
@ -47,15 +47,18 @@ unsigned char *Mod_DecompressVis(unsigned char *in, model_t *model)
|
||||
{
|
||||
return mod_novis;
|
||||
}
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
CM_DecompressPVS(in, decompressed, (model->numleafs + 7) / 8);
|
||||
#else
|
||||
int row = (model->numleafs + 7) / 8;
|
||||
// TODO: Move to model loading code
|
||||
|
||||
if (row < 0 || row > MODEL_MAX_PVS)
|
||||
{
|
||||
Sys_Error(__FUNCTION__ ": oversized model->numleafs: %i", model->numleafs);
|
||||
}
|
||||
|
||||
CM_DecompressPVS(in, decompressed, row);
|
||||
#endif
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
|
@ -1033,7 +1033,16 @@ void Mod_LoadLeafs(lump_t *l)
|
||||
|
||||
loadmodel->leafs = out;
|
||||
loadmodel->numleafs = count;
|
||||
#ifdef REHLDS_FIXES
|
||||
{
|
||||
int row = (loadmodel->numleafs + 7) / 8;
|
||||
|
||||
if (row < 0 || row > MODEL_MAX_PVS)
|
||||
{
|
||||
Sys_Error(__FUNCTION__ ": oversized loadmodel->numleafs: %i", loadmodel->numleafs);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < count; i++, in++, out++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
|
Loading…
Reference in New Issue
Block a user