mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
fix WalkTime for negativ positions
This commit is contained in:
parent
1dea02d456
commit
bc80d83ec9
|
@ -397,7 +397,12 @@ void CPlayers::RenderPlayer(
|
||||||
bool WantOtherDir = (Player.m_Direction == -1 && Vel.x > 0) || (Player.m_Direction == 1 && Vel.x < 0);
|
bool WantOtherDir = (Player.m_Direction == -1 && Vel.x > 0) || (Player.m_Direction == 1 && Vel.x < 0);
|
||||||
|
|
||||||
// evaluate animation
|
// 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;
|
CAnimState State;
|
||||||
State.Set(&g_pData->m_aAnimations[ANIM_BASE], 0);
|
State.Set(&g_pData->m_aAnimations[ANIM_BASE], 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue