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
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
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());
}