From e4ecfc4ee7b1d4b65ebbbd231314ecc77ad837b1 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Fri, 26 Feb 2021 19:06:27 -0500 Subject: [PATCH] Fixed #4791 since it is 100% a bug (#4801) * Fixed #4719 since it is 100% a bug This fix is somewhat janky as it checks if the rotation matches the exact original rotation but the likelihood of someone needing bridges along a belt rotated 1 or -1 times is super low. https://aethex.is-a.fail/t13ETd.webm * unjank rotation * fix potential crash, styling * Use mathf.mod --- core/src/mindustry/input/Placement.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index a60853e8e5..21532f21c7 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -119,6 +119,7 @@ public class Placement{ var result = plans1.clear(); var team = player.team(); + var rotated = plans.first().tile() != null && plans.first().tile().absoluteRelativeTo(plans.peek().x, plans.peek().y) == Mathf.mod(plans.first().rotation + 2, 4); outer: for(int i = 0; i < plans.size;){ @@ -144,7 +145,11 @@ public class Placement{ //found a link, assign bridges cur.block = bridge; other.block = bridge; - cur.config = new Point2(other.x - cur.x, other.y - cur.y); + if(rotated){ + other.config = new Point2(cur.x - other.x, cur.y - other.y); + }else{ + cur.config = new Point2(other.x - cur.x, other.y - cur.y); + } i = j; continue outer;