Skip to content

Commit

Permalink
perf: ignore objects that are already upright
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Apr 2, 2024
1 parent 872d918 commit dd6aab5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lc-hax/Scripts/Commands/UprightCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit dd6aab5

Please sign in to comment.