2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

SV_FatPVS/SV_FatPAS: Sanity checks, gPVSRowBytes is not used for singleplayer

This commit is contained in:
s1lentq 2021-05-03 00:39:06 +07:00
parent 80c40ce0c0
commit 2f70b6cba5

View File

@ -4057,10 +4057,12 @@ void SV_AddToFatPVS(vec_t *org, mnode_t *node)
unsigned char* EXT_FUNC SV_FatPVS(float *org) unsigned char* EXT_FUNC SV_FatPVS(float *org)
{ {
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (gPVS)
fatbytes = gPVSRowBytes; fatbytes = gPVSRowBytes;
#else // REHLDS_FIXES else
fatbytes = (g_psv.worldmodel->numleafs + 31) >> 3;
#endif // REHLDS_FIXES #endif // REHLDS_FIXES
fatbytes = (g_psv.worldmodel->numleafs + 31) >> 3;
Q_memset(fatpvs, 0, fatbytes); Q_memset(fatpvs, 0, fatbytes);
SV_AddToFatPVS(org, g_psv.worldmodel->nodes); SV_AddToFatPVS(org, g_psv.worldmodel->nodes);
return fatpvs; return fatpvs;
@ -4112,10 +4114,12 @@ void SV_AddToFatPAS(vec_t *org, mnode_t *node)
unsigned char* EXT_FUNC SV_FatPAS(float *org) unsigned char* EXT_FUNC SV_FatPAS(float *org)
{ {
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (gPAS)
fatpasbytes = gPVSRowBytes; fatpasbytes = gPVSRowBytes;
#else // REHLDS_FIXES else
fatpasbytes = (g_psv.worldmodel->numleafs + 31) >> 3;
#endif // REHLDS_FIXES #endif // REHLDS_FIXES
fatpasbytes = (g_psv.worldmodel->numleafs + 31) >> 3;
Q_memset(fatpas, 0, fatpasbytes); Q_memset(fatpas, 0, fatpasbytes);
SV_AddToFatPAS(org, g_psv.worldmodel->nodes); SV_AddToFatPAS(org, g_psv.worldmodel->nodes);
return fatpas; return fatpas;