From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sat, 20 Apr 2024 03:07:25 +0000 (+1000) Subject: Optimise immovable rod mapinit (#27149) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ef7f0b8322ab6a6d024b8042512b788c6133730f;p=space-station-14.git Optimise immovable rod mapinit (#27149) Redundant getworldpos. --- 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; } }