mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-24 11:02:48 +00:00
Implement overlay speed
This commit is contained in:
parent
df4b2074fd
commit
e3a6b6e15c
1 changed files with 10 additions and 0 deletions
|
|
@ -1074,6 +1074,16 @@ void K_UpdateTerrainOverlay(mobj_t *mo)
|
|||
mo->terrainOverlay->movefactor = o->scale;
|
||||
|
||||
K_SetTerrainOverlayState(mo, act, st);
|
||||
|
||||
if (mo->state->tics > 1 && o->speed > 0)
|
||||
{
|
||||
const fixed_t maxSpeed = 60 * mapobjectscale;
|
||||
fixed_t speed = P_AproxDistance(mo->momx, mo->momy);
|
||||
fixed_t speedDiv = FRACUNIT + FixedMul(FixedDiv(speed, maxSpeed), o->speed);
|
||||
tic_t animSpeed = max(FixedDiv(mo->state->tics, speedDiv), 1);
|
||||
|
||||
mo->tics = min(mo->tics, animSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue