From 73a5af2e5e65ea57185bb18c05261120c466147f Mon Sep 17 00:00:00 2001 From: azureblue Date: Sat, 24 Oct 2020 21:33:12 +0200 Subject: [PATCH 1/2] make ending direction follow the path --- core/src/mindustry/input/InputHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 8d2c376e94..87695c48c0 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1213,7 +1213,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ line.x = point.x; line.y = point.y; if(!overrideLineRotation || diagonal){ - line.rotation = next != null ? Tile.relativeTo(point.x, point.y, next.x, next.y) : baseRotation; + if (next != null){ + line.rotation = Tile.relativeTo(point.x, point.y, next.x, next.y); + }else if (block.conveyorPlacement && i > 0){ + Point2 prev = points.get(i - 1); + line.rotation = Tile.relativeTo(prev.x, prev.y, point.x, point.y); + }else{ + line.rotation = baseRotation; + } }else{ line.rotation = rotation; } From a7c24d4bfd3755abc1d07f5891b8371398cb7b4c Mon Sep 17 00:00:00 2001 From: azureblue Date: Sat, 24 Oct 2020 22:10:02 +0200 Subject: [PATCH 2/2] fixing formatting --- core/src/mindustry/input/InputHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 87695c48c0..bf3cb34f32 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1213,14 +1213,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ line.x = point.x; line.y = point.y; if(!overrideLineRotation || diagonal){ - if (next != null){ + if(next != null){ line.rotation = Tile.relativeTo(point.x, point.y, next.x, next.y); - }else if (block.conveyorPlacement && i > 0){ + }else if(block.conveyorPlacement && i > 0){ Point2 prev = points.get(i - 1); line.rotation = Tile.relativeTo(prev.x, prev.y, point.x, point.y); }else{ line.rotation = baseRotation; - } + } }else{ line.rotation = rotation; }