move missplaced code from DropDashWait to HandleDropDash

This commit is contained in:
Lighto97 2025-03-12 02:21:28 -03:00
parent ed5adc5b78
commit 4e4a3d3ba6

View file

@ -724,14 +724,7 @@ static void K_DropDashWait(player_t *player)
player->respawn.timer--; player->respawn.timer--;
if (player->pflags & PF_FAULT) if (player->pflags & PF_FAULT)
return; return;
// if player got trapped inside a bubble but lost its bubble object in a unintended way, remove no gravity flag
if (((P_MobjWasRemoved(player->mo->tracer) || player->mo->tracer == NULL) && player->carry == CR_TRAPBUBBLE) && (player->mo->flags & MF_NOGRAVITY))
{
player->mo->flags &= ~MF_NOGRAVITY;
player->carry = CR_NONE;
}
if (leveltime % 8 == 0) if (leveltime % 8 == 0)
{ {
@ -878,6 +871,12 @@ static void K_HandleDropDash(player_t *player)
{ {
player->mo->colorized = false; player->mo->colorized = false;
} }
// if player got trapped inside a bubble but lost its bubble object in a unintended way, remove no gravity flag
if (((P_MobjWasRemoved(player->mo->tracer) || player->mo->tracer == NULL || (!P_MobjWasRemoved(player->mo->tracer) && player->mo->tracer && player->mo->tracer->type != MT_BUBBLESHIELDTRAP)) && player->carry == CR_TRAPBUBBLE) && (player->mo->flags & MF_NOGRAVITY))
{
player->mo->flags &= ~MF_NOGRAVITY;
player->carry = CR_NONE;
}
} }
else else
{ {