3100: Fix offline client that is not in menu r=heinrich5991 a=Jupeyy

E.g. popups like "ddnet-info.json" failed will cause weird NaN glitches, bcs the impl relys on ChangePosition to clean movetime and animation start

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2020-10-14 21:54:46 +00:00 committed by GitHub
commit 9e060d78b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,12 +339,19 @@ bool CMenuBackground::Render()
XVal = pow(XVal, 7.0f);
m_Camera.m_Center = TargetPos + Dir * (XVal * Distance);
if(m_CurrentPosition < 0)
{
m_AnimationStartPos = m_Camera.m_Center;
m_MoveTime = 0.0f;
}
m_ChangedPosition = false;
}
CMapLayers::OnRender();
m_CurrentPosition = -1;
return true;
}