Skip to content
Snippets Groups Projects

Fix segfault when spectating on an Emerald Hunt map

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-segfault-emerald-hunt-spec into next
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -2512,6 +2512,8 @@ num:
@@ -2512,6 +2512,8 @@ num:
static INT32 ST_drawEmeraldHuntIcon(mobj_t *hunt, patch_t **patches, INT32 offset)
static INT32 ST_drawEmeraldHuntIcon(mobj_t *hunt, patch_t **patches, INT32 offset)
{
{
INT32 interval, i;
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;
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)
if (dist < 128)
Loading