Merge branch 'fix-segfault-emerald-hunt-spec' into 'next'

Fix segfault when spectating on an Emerald Hunt map

See merge request STJr/SRB2!2105
This commit is contained in:
sphere 2023-08-16 11:12:40 +00:00
commit 207aba0a52

View file

@ -2512,6 +2512,8 @@ num:
static INT32 ST_drawEmeraldHuntIcon(mobj_t *hunt, patch_t **patches, INT32 offset)
{
INT32 interval, i;
if (stplyr->mo == NULL)
return 0; // player just joined after spectating, can happen on custom gamemodes.
UINT32 dist = ((UINT32)P_AproxDistance(P_AproxDistance(stplyr->mo->x - hunt->x, stplyr->mo->y - hunt->y), stplyr->mo->z - hunt->z))>>FRACBITS;
if (dist < 128)