Fix crash when modifying animated model skeleton pose from gameplay code during update event

This commit is contained in:
Wojtek Figat
2023-06-30 11:02:58 +02:00
parent d5100373be
commit 2bd2bd5081
2 changed files with 8 additions and 1 deletions

View File

@@ -603,7 +603,13 @@ void AnimatedModel::OnAnimationUpdated_Sync()
// Update synchronous stuff
UpdateSockets();
ApplyRootMotion(GraphInstance.RootMotion);
AnimationUpdated();
if (!_isDuringUpdateEvent)
{
// Prevent stack-overflow when gameplay modifies the pose within the event
_isDuringUpdateEvent = true;
AnimationUpdated();
_isDuringUpdateEvent = false;
}
}
void AnimatedModel::OnAnimationUpdated()