Fix issues with gravflip of dropped items (rings, ctf flag, weapons, emeralds)

This commit is contained in:
krabs 2021-08-25 15:06:14 -04:00 committed by spherallic
parent 1f73c9cf99
commit 295555d0d0
2 changed files with 13 additions and 35 deletions

View file

@ -3882,8 +3882,10 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
if (i & 1)
P_SetObjectMomZ(mo, ns, true);
}
if (player->mo->eflags & MFE_VERTICALFLIP)
if (player->mo->eflags & MFE_VERTICALFLIP) {
mo->momz *= -1;
mo->flags2 |= MF2_OBJECTFLIP;
}
}
player->losstime += 10*TICRATE;
@ -4107,6 +4109,8 @@ void P_PlayerWeaponPanelOrAmmoBurst(player_t *player)
P_SetObjectMomZ(mo, 4*FRACUNIT, false); \
if (i & 1) \
P_SetObjectMomZ(mo, 4*FRACUNIT, true); \
if (player->mo->eflags & MFE_VERTICALFLIP) \
mo->flags2 |= MF2_OBJECTFLIP; \
++i; \
} \
else if (player->powers[power] > 0) \
@ -4126,6 +4130,8 @@ void P_PlayerWeaponPanelOrAmmoBurst(player_t *player)
P_SetObjectMomZ(mo, 3*FRACUNIT, false); \
if (i & 1) \
P_SetObjectMomZ(mo, 3*FRACUNIT, true); \
if (player->mo->eflags & MFE_VERTICALFLIP) \
mo->flags2 |= MF2_OBJECTFLIP; \
player->powers[power] = 0; \
++i; \
}
@ -4262,12 +4268,12 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss)
mo->momx = momx;
mo->momy = momy;
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->flags2 |= MF2_OBJECTFLIP;
P_SetObjectMomZ(mo, 3*FRACUNIT, false);
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->momz = -mo->momz;
if (toss)
player->tossdelay = 2*TICRATE;
}
@ -4294,8 +4300,10 @@ void P_PlayerFlagBurst(player_t *player, boolean toss)
flag = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, type);
if (player->mo->eflags & MFE_VERTICALFLIP)
if (player->mo->eflags & MFE_VERTICALFLIP) {
flag->z += player->mo->height - flag->height;
flag->flags2 |= MF2_OBJECTFLIP;
}
if (toss)
P_InstaThrust(flag, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale));

View file

@ -1522,36 +1522,6 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
{
switch (mo->type)
{
case MT_FLINGRING:
case MT_FLINGCOIN:
case MT_FLINGBLUESPHERE:
case MT_FLINGNIGHTSCHIP:
case MT_FLINGEMERALD:
case MT_BOUNCERING:
case MT_RAILRING:
case MT_INFINITYRING:
case MT_AUTOMATICRING:
case MT_EXPLOSIONRING:
case MT_SCATTERRING:
case MT_GRENADERING:
case MT_BOUNCEPICKUP:
case MT_RAILPICKUP:
case MT_AUTOPICKUP:
case MT_EXPLODEPICKUP:
case MT_SCATTERPICKUP:
case MT_GRENADEPICKUP:
case MT_REDFLAG:
case MT_BLUEFLAG:
if (mo->target)
{
// Flung items copy the gravity of their tosser.
if ((mo->target->eflags & MFE_VERTICALFLIP) && !(mo->eflags & MFE_VERTICALFLIP))
{
gravityadd = -gravityadd;
mo->eflags |= MFE_VERTICALFLIP;
}
}
break;
case MT_WATERDROP:
case MT_CYBRAKDEMON:
gravityadd >>= 1;