private void OnReleasePulledObject(ICommonSession? session)
{
- if (session?.AttachedEntity is not {Valid: true} player)
+ if (session?.AttachedEntity is not { Valid: true } player)
{
return;
}
pullerComp.Pulling = pullableUid;
pullableComp.Puller = pullerUid;
+ // store the pulled entity's physics FixedRotation setting in case we change it
+ pullableComp.PrevFixedRotation = pullablePhysics.FixedRotation;
+
// joint state handling will manage its own state
if (!_timing.ApplyingState)
{
_physics.SetFixedRotation(pullableUid, pullableComp.FixedRotationOnPull, body: pullablePhysics);
}
- pullableComp.PrevFixedRotation = pullablePhysics.FixedRotation;
-
// Messaging
var message = new PullStartedMessage(pullerUid, pullableUid);
_modifierSystem.RefreshMovementSpeedModifiers(pullerUid);