From ef7f0b8322ab6a6d024b8042512b788c6133730f Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sat, 20 Apr 2024 13:07:25 +1000 Subject: [PATCH] Optimise immovable rod mapinit (#27149) Redundant getworldpos. --- Content.Server/ImmovableRod/ImmovableRodSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index ce74777b07..f9873b0d6a 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -61,7 +61,7 @@ public sealed class ImmovableRodSystem : EntitySystem _physics.SetBodyStatus(uid, phys, BodyStatus.InAir); var xform = Transform(uid); - var worldRot = _transform.GetWorldRotation(uid); + var (worldPos, worldRot) = _transform.GetWorldPositionRotation(uid); var vel = worldRot.ToWorldVec() * component.MaxSpeed; if (component.RandomizeVelocity) @@ -74,7 +74,7 @@ public sealed class ImmovableRodSystem : EntitySystem } _physics.ApplyLinearImpulse(uid, vel, body: phys); - xform.LocalRotation = (vel - _transform.GetWorldPosition(uid)).ToWorldAngle() + MathHelper.PiOver2; + xform.LocalRotation = (vel - worldPos).ToWorldAngle() + MathHelper.PiOver2; } }