Fix #13755. Regression causing entity position corruption (#13828)

When switching from variable frame to fixed frame the entity positions could become corrupted. This would cause to end up being stuck inside of tiles that they could not path out of. When switching from normal speed to hyperspeed the rendering switches from variable to fixed frame. Therefore entitys could end up corrupted when enabling hyperspeed. Due to the way the corruption occured a hang or crash could also occur.
This commit is contained in:
Duncan authored and GitHub committed 2021-01-13 17:29:30 +00:00
1 parent 5c33773807
commit 0c91ed9bdd
1 file changed
+6
+6
View File
@@ -951,6 +951,12 @@ namespace OpenRCT2
{
_lastTick = 0;
_variableFrame = useVariableFrame;
// Switching from variable to fixed frame requires reseting
// of entity positions back to end of tick positions
auto& tweener = EntityTweener::Get();
tweener.Restore();
tweener.Reset();
}
if (useVariableFrame)