Fix caltrop burst in reverse gravity; condense function

I'm not sure how the rings were working though.
This commit is contained in:
James R 2021-02-16 03:54:09 -08:00
parent 4993d2ce39
commit b77a67c085

View file

@ -2138,7 +2138,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
static void P_FlingBurst static void P_FlingBurst
( player_t *player, ( player_t *player,
angle_t fa, angle_t fa,
fixed_t z,
mobjtype_t objType, mobjtype_t objType,
tic_t objFuse, tic_t objFuse,
fixed_t objScale, fixed_t objScale,
@ -2149,18 +2148,17 @@ static void P_FlingBurst
fixed_t momxy = 5<<FRACBITS, momz = 12<<FRACBITS; // base horizonal/vertical thrusts fixed_t momxy = 5<<FRACBITS, momz = 12<<FRACBITS; // base horizonal/vertical thrusts
INT32 mx = (i + 1) >> 1; INT32 mx = (i + 1) >> 1;
z = player->mo->z; mo = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, objType);
if (player->mo->eflags & MFE_VERTICALFLIP)
z += player->mo->height - mobjinfo[objType].height;
mo = P_SpawnMobj(player->mo->x, player->mo->y, z, objType);
mo->threshold = 10; // not useful for spikes mo->threshold = 10; // not useful for spikes
mo->fuse = objFuse; mo->fuse = objFuse;
P_SetTarget(&mo->target, player->mo); P_SetTarget(&mo->target, player->mo);
mo->destscale = objScale; if (objScale != FRACUNIT)
P_SetScale(mo, objScale); {
P_SetScale(mo, FixedMul(objScale, mo->scale));
mo->destscale = mo->scale;
}
/* /*
0: 0 0: 0
@ -2197,7 +2195,6 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
INT32 num_fling_rings; INT32 num_fling_rings;
INT32 i; INT32 i;
angle_t fa; angle_t fa;
fixed_t z;
// Rings shouldn't be in Battle! // Rings shouldn't be in Battle!
if (gametyperules & GTR_SPHERES) if (gametyperules & GTR_SPHERES)
@ -2224,19 +2221,13 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
// determine first angle // determine first angle
fa = player->mo->angle + ((P_RandomByte() & 1) ? -ANGLE_90 : ANGLE_90); fa = player->mo->angle + ((P_RandomByte() & 1) ? -ANGLE_90 : ANGLE_90);
z = player->mo->z;
if (player->mo->eflags & MFE_VERTICALFLIP)
z += player->mo->height - mobjinfo[MT_RING].height;
for (i = 0; i < num_fling_rings; i++) for (i = 0; i < num_fling_rings; i++)
{ {
P_FlingBurst(player, fa, z, P_FlingBurst(player, fa, MT_FLINGRING, 60*TICRATE, FRACUNIT, i);
MT_FLINGRING, 60*TICRATE, player->mo->scale, i);
} }
while (i < num_rings) while (i < num_rings)
{ {
P_FlingBurst(player, fa, z, P_FlingBurst(player, fa, MT_DEBTSPIKE, 0, 3 * FRACUNIT / 2, i++);
MT_DEBTSPIKE, 0, 3 * player->mo->scale / 2, i++);
} }
} }