fix WalkTime for negativ positions

This commit is contained in:
c0d3d3v 2022-04-25 18:49:22 +02:00
parent 1dea02d456
commit bc80d83ec9
No known key found for this signature in database
GPG key ID: 068AF680530DFF31

View file

@ -397,7 +397,12 @@ void CPlayers::RenderPlayer(
bool WantOtherDir = (Player.m_Direction == -1 && Vel.x > 0) || (Player.m_Direction == 1 && Vel.x < 0);
// evaluate animation
float WalkTime = fmod(absolute(Position.x), 100.0f) / 100.0f;
float WalkTime = fmod(Position.x, 100.0f) / 100.0f;
if(WalkTime < 0)
{
// Don't do a moon walk outside the left border
WalkTime += 1;
}
CAnimState State;
State.Set(&g_pData->m_aAnimations[ANIM_BASE], 0);