mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 19:50:51 +00:00
Merge branch 'bump-fixes' into 'next'
Push bouncing players backwards if they get stuck in a wall See merge request KartKrew/Kart-Public!3
This commit is contained in:
commit
e52d5fd2fd
1 changed files with 4 additions and 1 deletions
|
@ -3809,6 +3809,7 @@ void P_BouncePlayerMove(mobj_t *mo)
|
||||||
fixed_t leadx, leady;
|
fixed_t leadx, leady;
|
||||||
fixed_t trailx, traily;
|
fixed_t trailx, traily;
|
||||||
fixed_t mmomx = 0, mmomy = 0;
|
fixed_t mmomx = 0, mmomy = 0;
|
||||||
|
fixed_t oldmomx = mo->momx, oldmomy = mo->momy;
|
||||||
|
|
||||||
if (!mo->player)
|
if (!mo->player)
|
||||||
return;
|
return;
|
||||||
|
@ -3897,7 +3898,9 @@ void P_BouncePlayerMove(mobj_t *mo)
|
||||||
mo->player->cmomx = tmxmove;
|
mo->player->cmomx = tmxmove;
|
||||||
mo->player->cmomy = tmymove;
|
mo->player->cmomy = tmymove;
|
||||||
|
|
||||||
P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true);
|
if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true)) {
|
||||||
|
P_TryMove(mo, mo->x - oldmomx, mo->y - oldmomy, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue