mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 23:41:48 +00:00
We did it, we finally fixed... The Shell Boost Bug
Instead of adding to your speed, it relatively multiplies it if you're above your top speed. This is applied to ALL of Kart projectiles as well, not just shells. May we never run into our own shell that we threw on a boost pad ever again.
This commit is contained in:
parent
dd05edfcc0
commit
b4757779cd
1 changed files with 10 additions and 6 deletions
16
src/k_kart.c
16
src/k_kart.c
|
@ -1767,6 +1767,7 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
mobj_t *th;
|
||||
angle_t an;
|
||||
fixed_t x, y, z;
|
||||
fixed_t finalspeed = speed;
|
||||
mobj_t *throwmo;
|
||||
//INT32 dir;
|
||||
|
||||
|
@ -1778,8 +1779,11 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
//else
|
||||
// dir = 1;
|
||||
|
||||
x = source->x + source->momx;
|
||||
y = source->y + source->momy;
|
||||
if (source->player && source->player->speed > K_GetKartSpeed(source->player, false))
|
||||
finalspeed = FixedMul(speed, FixedDiv(source->player->speed, K_GetKartSpeed(source->player, false)));
|
||||
|
||||
x = source->x + source->momx + FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT));
|
||||
y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||
z = source->z; // spawn on the ground please
|
||||
|
||||
if (P_MobjFlip(source) < 0)
|
||||
|
@ -1821,11 +1825,11 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
}
|
||||
|
||||
th->angle = an;
|
||||
th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT));
|
||||
th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||
th->momx = FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT));
|
||||
th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||
|
||||
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
|
||||
x = y + P_ReturnThrustY(source, an, source->radius + th->radius);
|
||||
y = y + P_ReturnThrustY(source, an, source->radius + th->radius);
|
||||
throwmo = P_SpawnMobj(x, y, z, MT_FIREDITEM);
|
||||
throwmo->movecount = 1;
|
||||
throwmo->movedir = source->angle - an;
|
||||
|
@ -1977,7 +1981,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
|
|||
else
|
||||
{
|
||||
// Shoot forward
|
||||
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle, 0, PROJSPEED + player->speed);
|
||||
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle, 0, PROJSPEED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue