Make P_CanPickupItem check whether Sonic is in a state to recieve it when Tailsbot tries to get it.
Specfically, this fixes the case where Sonic runs into something hazardous and spills his rings, but Tailsbot is immediately behind and ends up picking them all up the tic before they also get hurt.
This commit is contained in:
parent
e8b3f84741
commit
6ac44415fb
|
@ -148,15 +148,21 @@ void P_ResetStarposts(void)
|
||||||
//
|
//
|
||||||
boolean P_CanPickupItem(player_t *player, boolean weapon)
|
boolean P_CanPickupItem(player_t *player, boolean weapon)
|
||||||
{
|
{
|
||||||
if (player->bot && weapon)
|
soniccheck:
|
||||||
|
if (!player->mo || player->mo->health <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (player->bot)
|
||||||
|
{
|
||||||
|
if (weapon || players[consoleplayer].bot)
|
||||||
|
return false;
|
||||||
|
player = &players[consoleplayer];
|
||||||
|
goto soniccheck;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX)
|
if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (player->mo && player->mo->health <= 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue