mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 03:22:35 +00:00
Merge branch 'squish-that-kart' into 'master'
More squish tweaks See merge request KartKrew/Kart!485
This commit is contained in:
commit
ca76754248
1 changed files with 11 additions and 6 deletions
17
src/k_kart.c
17
src/k_kart.c
|
|
@ -4545,13 +4545,18 @@ void K_DriftDustHandling(mobj_t *spawner)
|
|||
void K_Squish(mobj_t *mo)
|
||||
{
|
||||
const fixed_t maxstretch = 4*FRACUNIT;
|
||||
const fixed_t factor = 3 * mo->height / 2;
|
||||
const fixed_t factor = 5 * mo->height / 4;
|
||||
const fixed_t threshold = factor / 6;
|
||||
|
||||
const fixed_t old3dspeed = abs(mo->lastmomz);
|
||||
const fixed_t new3dspeed = abs(mo->momz);
|
||||
fixed_t old3dspeed = abs(mo->lastmomz);
|
||||
fixed_t new3dspeed = abs(mo->momz);
|
||||
|
||||
const fixed_t delta = abs(old3dspeed - new3dspeed);
|
||||
fixed_t delta = abs(old3dspeed - new3dspeed);
|
||||
fixed_t grav = mo->height/3;
|
||||
fixed_t add = abs(grav - new3dspeed);
|
||||
|
||||
if (delta < 2 * add && new3dspeed > grav)
|
||||
delta += add;
|
||||
|
||||
if (delta > threshold)
|
||||
{
|
||||
|
|
@ -4561,7 +4566,7 @@ void K_Squish(mobj_t *mo)
|
|||
if (mo->spritexscale > maxstretch)
|
||||
mo->spritexscale = maxstretch;
|
||||
|
||||
if (abs(new3dspeed) > abs(old3dspeed))
|
||||
if (new3dspeed > old3dspeed || new3dspeed > grav)
|
||||
{
|
||||
mo->spritexscale =
|
||||
FixedDiv(FRACUNIT, mo->spritexscale);
|
||||
|
|
@ -4571,7 +4576,7 @@ void K_Squish(mobj_t *mo)
|
|||
{
|
||||
mo->spritexscale -=
|
||||
(mo->spritexscale - FRACUNIT)
|
||||
/ (mo->spritexscale < FRACUNIT ? 8 : 2);
|
||||
/ (mo->spritexscale < FRACUNIT ? 8 : 3);
|
||||
}
|
||||
|
||||
mo->spriteyscale =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue