]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Optimise immovable rod mapinit (#27149)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sat, 20 Apr 2024 03:07:25 +0000 (13:07 +1000)
committerGitHub <noreply@github.com>
Sat, 20 Apr 2024 03:07:25 +0000 (13:07 +1000)
Redundant getworldpos.

Content.Server/ImmovableRod/ImmovableRodSystem.cs

index ce74777b07069066e980d49f844a022462ddf9a4..f9873b0d6a99f62354f0f37e602fd3596e14b4d4 100644 (file)
@@ -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;
         }
     }