1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Fix #20285: Workaround to disable tweening when updated from UI

This commit is contained in:
ζeh Matt
2023-05-24 00:58:05 +03:00
parent 65b582afb0
commit b3606566c4
2 changed files with 8 additions and 1 deletions

View File

@@ -473,6 +473,13 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation)
EntitySetCoordinates(loc, this);
Invalidate(); // Invalidate new position.
}
if (!gInUpdateCode)
{
// Make sure we don't tween when the position was modified outside of the
// update loop.
RenderFlags |= EntityRenderFlags::kInvalidateTweening;
}
}
void EntitySetCoordinates(const CoordsXYZ& entityPos, EntityBase* entity)

View File

@@ -19,7 +19,7 @@
void EntityTweener::AddEntity(EntityBase* entity)
{
entity->RenderFlags &= ~EntityRenderFlags::kInvalidateTweening;
Entities.push_back(entity);
PrePos.emplace_back(entity->GetLocation());
}