Some safeguards for K_DropRocketSneaker usage

This commit is contained in:
Ashnal 2020-07-14 19:45:15 -04:00
parent 0637ed89aa
commit 943a898352
2 changed files with 7 additions and 3 deletions

View file

@ -3872,11 +3872,17 @@ void K_DropItems(player_t *player)
void K_DropRocketSneaker(player_t *player)
{
if (!(player->mo && !P_MobjWasRemoved(player->mo) && player->mo->hnext && !P_MobjWasRemoved(player->mo->hnext)))
return;
mobj_t *shoe = player->mo;
fixed_t flingangle;
boolean leftshoe = true; //left shoie is first
while ((shoe = shoe->hnext) && !P_MobjWasRemoved(shoe))
{
if (shoe->type != MT_ROCKETSNEAKER)
return; //woah, not a rocketsneaker, bail! safeguard in case this gets used when you're holding non-rocketsneakers
shoe->flags2 &= ~MF2_DONTDRAW;
shoe->flags &= ~MF_NOGRAVITY;
shoe->angle += ANGLE_45;

View file

@ -408,9 +408,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
else
{
if (player->kartstuff[k_rocketsneakertimer])
K_DropRocketSneaker(player);
K_DropItems(player); //K_StripItems(player);
//K_StripOther(player);
player->kartstuff[k_itemroulette] = 1;