From 1985d67f7aae321452aeca7bd4f728b887d9fe4d Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 3 Oct 2025 18:41:12 +0900 Subject: [PATCH] Closes Anuken/Mindustry-Suggestions/issues/5877 --- core/src/mindustry/input/InputHandler.java | 2 +- core/src/mindustry/world/Block.java | 2 ++ core/src/mindustry/world/blocks/defense/turrets/Turret.java | 1 + core/src/mindustry/world/blocks/production/BeamDrill.java | 1 + core/src/mindustry/world/blocks/production/WallCrafter.java | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 4efda4f62e..56538fafd9 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -2254,7 +2254,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ Point2 next = i == points.size - 1 ? null : points.get(i + 1); line.x = point.x; line.y = point.y; - if(!overrideLineRotation || diagonal){ + if((!overrideLineRotation || diagonal) && !(block != null && block.ignoreLineRotation)){ int result = baseRotation; if(next != null){ result = Tile.relativeTo(point.x, point.y, next.x, next.y); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 00033dc64a..49751d8d68 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -118,6 +118,8 @@ public class Block extends UnlockableContent implements Senseable{ public float visualRotationOffset = 0f; /** if rotate = false and this is true, rotation will be locked at 0 when placing (default); advanced use only */ public boolean lockRotation = true; + /** if true, this block won't face the line drag direction */ + public boolean ignoreLineRotation = false; /** if true, schematic flips with this block are inverted. */ public boolean invertFlip = false; /** number of different variant regions to use */ diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index bfb2396af0..105be42df5 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -160,6 +160,7 @@ public class Turret extends ReloadTurret{ rotate = true; quickRotate = false; drawArrow = false; + ignoreLineRotation = true; rotateDrawEditor = false; visualRotationOffset = -90f; regionRotated1 = 1; diff --git a/core/src/mindustry/world/blocks/production/BeamDrill.java b/core/src/mindustry/world/blocks/production/BeamDrill.java index 08c3cada1c..5e126478f0 100644 --- a/core/src/mindustry/world/blocks/production/BeamDrill.java +++ b/core/src/mindustry/world/blocks/production/BeamDrill.java @@ -69,6 +69,7 @@ public class BeamDrill extends Block{ solid = true; drawArrow = false; regionRotated1 = 1; + ignoreLineRotation = true; ambientSoundVolume = 0.05f; ambientSound = Sounds.minebeam; diff --git a/core/src/mindustry/world/blocks/production/WallCrafter.java b/core/src/mindustry/world/blocks/production/WallCrafter.java index 9c70967212..bc3dfb0ae7 100644 --- a/core/src/mindustry/world/blocks/production/WallCrafter.java +++ b/core/src/mindustry/world/blocks/production/WallCrafter.java @@ -57,6 +57,7 @@ public class WallCrafter extends Block{ rotate = true; update = true; solid = true; + ignoreLineRotation = true; regionRotated1 = 1; envEnabled |= Env.space;