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:
@@ -310,7 +310,7 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnReleasePulledObject(ICommonSession? session)
|
private void OnReleasePulledObject(ICommonSession? session)
|
||||||
{
|
{
|
||||||
if (session?.AttachedEntity is not {Valid: true} player)
|
if (session?.AttachedEntity is not { Valid: true } player)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -447,6 +447,9 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
pullerComp.Pulling = pullableUid;
|
pullerComp.Pulling = pullableUid;
|
||||||
pullableComp.Puller = pullerUid;
|
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
|
// joint state handling will manage its own state
|
||||||
if (!_timing.ApplyingState)
|
if (!_timing.ApplyingState)
|
||||||
{
|
{
|
||||||
@@ -465,8 +468,6 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
_physics.SetFixedRotation(pullableUid, pullableComp.FixedRotationOnPull, body: pullablePhysics);
|
_physics.SetFixedRotation(pullableUid, pullableComp.FixedRotationOnPull, body: pullablePhysics);
|
||||||
}
|
}
|
||||||
|
|
||||||
pullableComp.PrevFixedRotation = pullablePhysics.FixedRotation;
|
|
||||||
|
|
||||||
// Messaging
|
// Messaging
|
||||||
var message = new PullStartedMessage(pullerUid, pullableUid);
|
var message = new PullStartedMessage(pullerUid, pullableUid);
|
||||||
_modifierSystem.RefreshMovementSpeedModifiers(pullerUid);
|
_modifierSystem.RefreshMovementSpeedModifiers(pullerUid);
|
||||||
|
|||||||
Reference in New Issue
Block a user