The rope release component disconnects a rope when the angle exceeds a certain value. It does this during the constraint update process, which results in an invalid state.
Rope disconnects here:
MyHavokConstraint<HkRopeConstraintData>.OnDeactivate()
MyRopeConstraint.OnDeactivate()
MyConstraint.Deactivate()
MyPhysicsConstraintGroup.OnLinkRemoved()
MyTieredComponentGroup<MyPhysicsComponentBase, MyConstraintAttachmentComponent>.RemoveLink()
MyScene.GroupRemoveLinkInternal<VRage.Components.Physics.MyPhysicsConstraintGroup, VRage.Components.Physics.MyConstraintAttachmentComponent>()
MyScene.GroupRemoveLinkSynchronized<VRage.Components.Physics.MyPhysicsConstraintGroup, VRage.Components.Physics.MyConstraintAttachmentComponent>()
MyScene.Unlink<VRage.Components.Physics.MyPhysicsConstraintGroup, VRage.Components.Physics.MyConstraintAttachmentComponent>()
GroupProxyExtensions.Unlink<VRage.Components.Physics.MyPhysicsConstraintGroup, VRage.Components.Physics.MyConstraintAttachmentComponent>()
MyConstraint.Disconnect()
MyRopeReleaseComponent.UpdateRelease()
MyRopeReleaseComponent.OnConstraintUpdate()
MyConstraint.Update()
MyBreakableConstraint<HkRopeConstraintData>.Update()
MyRopeConstraint.Update()
MyPhysicsConstraintGroup.Update()
But then immediately after disconnection, the update proceeds and the other side of the constraint attempts to update and fails because the constraint is now invalid:
MyLockableRopeDrumComponent.OnConstraintUpdate() // the constraint is null here, which causes a crash
MyConstraint.Update()
MyBreakableConstraint<HkRopeConstraintData>.Update()
MyRopeConstraint.Update()
MyPhysicsConstraintGroup.Update()
|