From dd6aab5f8e2c889352690897b535332f706b0641 Mon Sep 17 00:00:00 2001 From: winstxnhdw Date: Wed, 3 Apr 2024 03:22:10 +0800 Subject: [PATCH] perf: ignore objects that are already upright --- lc-hax/Scripts/Commands/UprightCommand.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lc-hax/Scripts/Commands/UprightCommand.cs b/lc-hax/Scripts/Commands/UprightCommand.cs index 5715e2fa..d7643bd8 100644 --- a/lc-hax/Scripts/Commands/UprightCommand.cs +++ b/lc-hax/Scripts/Commands/UprightCommand.cs @@ -5,8 +5,12 @@ class UprightCommand : ICommand { void SetObjectUpright(PlaceableShipObject shipObject) { Vector3 uprightRotation = shipObject.transform.eulerAngles; - uprightRotation.x = -90.0f; + if (uprightRotation.x == -90.0f) { + return; + } + + uprightRotation.x = -90.0f; Helper.PlaceObjectAtPosition(shipObject, shipObject.transform.position, uprightRotation); }