Fixes objects changing physics behavior after being pulled (#29694)
* Fixes pull rotation logic * cleaner condition * even less code * I CHANGED MY MIND * first one * second one --------- Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
parent
143151f284
commit
48ae8ce0a8
1 changed files with 4 additions and 3 deletions
|
|
@ -310,7 +310,7 @@ public sealed class PullingSystem : EntitySystem
|
|||
|
||||
private void OnReleasePulledObject(ICommonSession? session)
|
||||
{
|
||||
if (session?.AttachedEntity is not {Valid: true} player)
|
||||
if (session?.AttachedEntity is not { Valid: true } player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -447,6 +447,9 @@ public sealed class PullingSystem : EntitySystem
|
|||
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)
|
||||
{
|
||||
|
|
@ -465,8 +468,6 @@ public sealed class PullingSystem : EntitySystem
|
|||
_physics.SetFixedRotation(pullableUid, pullableComp.FixedRotationOnPull, body: pullablePhysics);
|
||||
}
|
||||
|
||||
pullableComp.PrevFixedRotation = pullablePhysics.FixedRotation;
|
||||
|
||||
// Messaging
|
||||
var message = new PullStartedMessage(pullerUid, pullableUid);
|
||||
_modifierSystem.RefreshMovementSpeedModifiers(pullerUid);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue