Various antigrav item fixes

This commit is contained in:
Latapostrophe 2020-07-24 15:51:59 +02:00
parent b8f2fe4bcc
commit fcacb092b7

View file

@ -2909,13 +2909,10 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
z = source->z; // spawn on the ground please z = source->z; // spawn on the ground please
if (P_MobjFlip(source) < 0)
{
z = source->z+source->height - mobjinfo[type].height;
}
th = P_SpawnMobj(x, y, z, type); th = P_SpawnMobj(x, y, z, type);
K_FlipFromObject(th, source);
th->flags2 |= flags2; th->flags2 |= flags2;
th->threshold = 10; th->threshold = 10;
@ -3654,8 +3651,8 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
if (player->mo->eflags & MFE_VERTICALFLIP) if (player->mo->eflags & MFE_VERTICALFLIP)
{ {
mo->z -= player->mo->height; mo->z -= player->mo->height;
mo->flags2 |= MF2_OBJECTFLIP;
mo->eflags |= MFE_VERTICALFLIP; mo->eflags |= MFE_VERTICALFLIP;
mo->flags2 |= (player->mo->flags2 & MF2_OBJECTFLIP);
} }
mo->threshold = 10; mo->threshold = 10;
@ -3685,8 +3682,8 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
if (player->mo->eflags & MFE_VERTICALFLIP) if (player->mo->eflags & MFE_VERTICALFLIP)
{ {
throwmo->z -= player->mo->height; throwmo->z -= player->mo->height;
throwmo->flags2 |= MF2_OBJECTFLIP;
throwmo->eflags |= MFE_VERTICALFLIP; throwmo->eflags |= MFE_VERTICALFLIP;
mo->flags2 |= (player->mo->flags2 & MF2_OBJECTFLIP);
} }
throwmo->movecount = 0; // above player throwmo->movecount = 0; // above player
@ -4296,6 +4293,7 @@ void K_DropHnextList(player_t *player, boolean keepshields)
dropwork->flags |= MF_NOCLIPTHING; dropwork->flags |= MF_NOCLIPTHING;
dropwork->flags2 = work->flags2; dropwork->flags2 = work->flags2;
dropwork->eflags = work->eflags;
dropwork->floorz = work->floorz; dropwork->floorz = work->floorz;
dropwork->ceilingz = work->ceilingz; dropwork->ceilingz = work->ceilingz;
@ -4402,6 +4400,8 @@ void K_DropItems(player_t *player)
drop->threshold = player->kartstuff[k_itemtype]; drop->threshold = player->kartstuff[k_itemtype];
drop->movecount = player->kartstuff[k_itemamount]; drop->movecount = player->kartstuff[k_itemamount];
K_FlipFromObject(drop, player->mo);
drop->flags |= MF_NOCLIPTHING; drop->flags |= MF_NOCLIPTHING;
} }
@ -4747,6 +4747,9 @@ static void K_MoveHeldObjects(player_t *player)
cur->flags &= ~MF_NOCLIPTHING; cur->flags &= ~MF_NOCLIPTHING;
if ((player->mo->eflags & MFE_VERTICALFLIP) != (cur->eflags & MFE_VERTICALFLIP))
K_FlipFromObject(cur, player->mo);
if (!cur->health) if (!cur->health)
{ {
cur = cur->hnext; cur = cur->hnext;
@ -6956,6 +6959,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EGGMANITEM_SHIELD); mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EGGMANITEM_SHIELD);
if (mo) if (mo)
{ {
K_FlipFromObject(mo, player->mo);
mo->flags |= MF_NOCLIPTHING; mo->flags |= MF_NOCLIPTHING;
mo->threshold = 10; mo->threshold = 10;
mo->movecount = 1; mo->movecount = 1;