Keep Metal's jet fume at a consistent height during dashmode

This commit is contained in:
lachwright 2021-01-14 04:24:48 +11:00
parent d2be3110bd
commit 149535634e

View file

@ -11357,6 +11357,7 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume)
mobj_t *mo = player->mo; mobj_t *mo = player->mo;
angle_t angle = player->drawangle; angle_t angle = player->drawangle;
fixed_t dist; fixed_t dist;
fixed_t playerheight = P_GetPlayerHeight(player);
panim_t panim = player->panim; panim_t panim = player->panim;
tic_t dashmode = player->dashmode; tic_t dashmode = player->dashmode;
boolean underwater = mo->eflags & MFE_UNDERWATER; boolean underwater = mo->eflags & MFE_UNDERWATER;
@ -11390,7 +11391,7 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume)
offsetV = i*P_ReturnThrustY(fume, fume->movedir, radiusV); offsetV = i*P_ReturnThrustY(fume, fume->movedir, radiusV);
x = mo->x + radiusX + FixedMul(offsetH, factorX); x = mo->x + radiusX + FixedMul(offsetH, factorX);
y = mo->y + radiusY + FixedMul(offsetH, factorY); y = mo->y + radiusY + FixedMul(offsetH, factorY);
z = mo->z + (mo->height >> 1) + offsetV; z = mo->z + (playerheight >> 1) + offsetV;
P_SpawnMobj(x, y, z, MT_SMALLBUBBLE)->scale = mo->scale >> 1; P_SpawnMobj(x, y, z, MT_SMALLBUBBLE)->scale = mo->scale >> 1;
} }
@ -11453,7 +11454,7 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume)
P_UnsetThingPosition(fume); P_UnsetThingPosition(fume);
fume->x = mo->x + P_ReturnThrustX(fume, angle, dist); fume->x = mo->x + P_ReturnThrustX(fume, angle, dist);
fume->y = mo->y + P_ReturnThrustY(fume, angle, dist); fume->y = mo->y + P_ReturnThrustY(fume, angle, dist);
fume->z = mo->z + ((mo->height - fume->height) >> 1); fume->z = mo->z + ((playerheight - fume->height) >> 1);
P_SetThingPosition(fume); P_SetThingPosition(fume);
// If dashmode is high enough, spawn a trail // If dashmode is high enough, spawn a trail