mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 02:01:15 +00:00
Minimum wall bump speed copied from K_KartBouncing
This commit is contained in:
parent
96fde413f4
commit
e57b9f3f77
1 changed files with 22 additions and 0 deletions
22
src/p_map.c
22
src/p_map.c
|
@ -3948,6 +3948,28 @@ bounceback:
|
||||||
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mo->player)
|
||||||
|
{
|
||||||
|
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
fx->eflags |= MFE_VERTICALFLIP;
|
||||||
|
else
|
||||||
|
fx->eflags &= ~MFE_VERTICALFLIP;
|
||||||
|
fx->scale = mo->scale;
|
||||||
|
|
||||||
|
if (cv_collidesounds.value == 1)
|
||||||
|
S_StartSound(mo, cv_collidesoundnum.value);
|
||||||
|
|
||||||
|
if (P_AproxDistance(tmxmove, tmymove) < 25*FRACUNIT)
|
||||||
|
{
|
||||||
|
fixed_t momdiflength = P_AproxDistance(tmxmove, tmymove);
|
||||||
|
fixed_t normalisedx = FixedDiv(tmxmove, momdiflength);
|
||||||
|
fixed_t normalisedy = FixedDiv(tmymove, momdiflength);
|
||||||
|
tmxmove = FixedMul(25*FRACUNIT, normalisedx);
|
||||||
|
tmymove = FixedMul(25*FRACUNIT, normalisedy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
P_HitBounceLine(bestslideline); // clip the moves
|
P_HitBounceLine(bestslideline); // clip the moves
|
||||||
|
|
||||||
mo->momx = tmxmove;
|
mo->momx = tmxmove;
|
||||||
|
|
Loading…
Reference in a new issue