Fix use-after-remove when bailing with attracting rings

This commit is contained in:
Antonio Martinez 2025-07-03 02:17:45 -04:00 committed by AJ Martinez
parent 3bc26f2e75
commit 1d6ade51ae

View file

@ -14193,8 +14193,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// really silly stupid dumb HACK to fix interp
// without needing to duplicate any code
A_AttractChase(ring);
P_SetOrigin(ring, ring->x, ring->y, ring->z);
ring->extravalue1 = 1;
// ring can be removed if the player is in a state that explicitly blocks ring pickup
// try not to go crazy for a week figuring out why bail randomly crashes :))))))
if (ring && !P_MobjWasRemoved(ring))
{
P_SetOrigin(ring, ring->x, ring->y, ring->z);
ring->extravalue1 = 1;
}
UINT8 dumprate = 3;