Fix crash when modifying animated model skeleton pose from gameplay code during update event
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -60,6 +60,7 @@ private:
|
||||
AnimationUpdateMode _actualMode;
|
||||
uint32 _counter;
|
||||
Real _lastMinDstSqr;
|
||||
bool _isDuringUpdateEvent = false;
|
||||
uint64 _lastUpdateFrame;
|
||||
BlendShapesInstance _blendShapes;
|
||||
ScriptingObjectReference<AnimatedModel> _masterPose;
|
||||
|
||||
Reference in New Issue
Block a user