mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Adjust PlayerPointerRemove macros + associated to check validity before removal
This commit is contained in:
parent
120b567ba2
commit
ccbcd203dd
4 changed files with 15 additions and 8 deletions
|
|
@ -2540,7 +2540,7 @@ void CL_ClearPlayer(INT32 playernum)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PlayerPointerRemove(field) \
|
#define PlayerPointerRemove(field) \
|
||||||
if (field) \
|
if (P_MobjWasRemoved(field) == false) \
|
||||||
{ \
|
{ \
|
||||||
P_RemoveMobj(field); \
|
P_RemoveMobj(field); \
|
||||||
P_SetTarget(&field, NULL); \
|
P_SetTarget(&field, NULL); \
|
||||||
|
|
|
||||||
|
|
@ -2234,7 +2234,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
K_RemoveFollower(&players[player]);
|
K_RemoveFollower(&players[player]);
|
||||||
|
|
||||||
#define PlayerPointerRemove(field) \
|
#define PlayerPointerRemove(field) \
|
||||||
if (field) \
|
if (P_MobjWasRemoved(field) == false) \
|
||||||
{ \
|
{ \
|
||||||
P_RemoveMobj(field); \
|
P_RemoveMobj(field); \
|
||||||
P_SetTarget(&field, NULL); \
|
P_SetTarget(&field, NULL); \
|
||||||
|
|
|
||||||
|
|
@ -4063,7 +4063,7 @@ void K_InitStumbleIndicator(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->stumbleIndicator != NULL && P_MobjWasRemoved(player->stumbleIndicator) == false)
|
if (P_MobjWasRemoved(player->stumbleIndicator) == false)
|
||||||
{
|
{
|
||||||
P_RemoveMobj(player->stumbleIndicator);
|
P_RemoveMobj(player->stumbleIndicator);
|
||||||
}
|
}
|
||||||
|
|
@ -4088,7 +4088,7 @@ void K_InitSliptideZipIndicator(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->stumbleIndicator != NULL && P_MobjWasRemoved(player->sliptideZipIndicator) == false)
|
if (P_MobjWasRemoved(player->sliptideZipIndicator) == false)
|
||||||
{
|
{
|
||||||
P_RemoveMobj(player->sliptideZipIndicator);
|
P_RemoveMobj(player->sliptideZipIndicator);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2550,10 +2550,17 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
|
|
||||||
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
||||||
|
|
||||||
if (player->sliptideZipIndicator && !P_MobjWasRemoved(player->sliptideZipIndicator))
|
#define PlayerPointerRemove(field) \
|
||||||
P_RemoveMobj(player->sliptideZipIndicator);
|
if (P_MobjWasRemoved(field) == false) \
|
||||||
if (player->stumbleIndicator && !P_MobjWasRemoved(player->stumbleIndicator))
|
{ \
|
||||||
P_RemoveMobj(player->stumbleIndicator);
|
P_RemoveMobj(field); \
|
||||||
|
P_SetTarget(&field, NULL); \
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerPointerRemove(player->stumbleIndicator);
|
||||||
|
PlayerPointerRemove(player->sliptideZipIndicator);
|
||||||
|
|
||||||
|
#undef PlayerPointerRemove
|
||||||
|
|
||||||
if (type == DMG_TIMEOVER)
|
if (type == DMG_TIMEOVER)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue