From 77410ce10670dea2f56361153a8c8f604b9abf72 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 7 Feb 2022 14:40:13 -0500 Subject: [PATCH] Fixed beam-to-node connections --- core/src/mindustry/world/blocks/power/BeamNode.java | 5 +++-- core/src/mindustry/world/blocks/power/LongPowerNode.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/BeamNode.java b/core/src/mindustry/world/blocks/power/BeamNode.java index a6636a99bc..00c86e210a 100644 --- a/core/src/mindustry/world/blocks/power/BeamNode.java +++ b/core/src/mindustry/world/blocks/power/BeamNode.java @@ -61,7 +61,7 @@ public class BeamNode extends PowerBlock{ int offset = size/2; for(int j = 1 + offset; j <= range + offset; j++){ var other = world.build(x + j * dir.x, y + j * dir.y); - if(other != null && other.block.hasPower && other.team == Vars.player.team()){ + if(other != null && other.block.hasPower && other.team == Vars.player.team() && !(other.block instanceof PowerNode)){ maxLen = j; dest = other; break; @@ -145,7 +145,8 @@ public class BeamNode extends PowerBlock{ //find first block with power in range for(int j = 1 + offset; j <= range + offset; j++){ var other = world.build(tile.x + j * dir.x, tile.y + j * dir.y); - if(other != null && other.block.hasPower && other.team == team){ + //power nodes do NOT play nice with beam nodes, do not touch them as that forcefully modifies their links + if(other != null && other.block.hasPower && other.team == team && !(other.block instanceof PowerNode)){ links[i] = other; dests[i] = world.tile(tile.x + j * dir.x, tile.y + j * dir.y); break; diff --git a/core/src/mindustry/world/blocks/power/LongPowerNode.java b/core/src/mindustry/world/blocks/power/LongPowerNode.java index ac2e00b84c..3af930337e 100644 --- a/core/src/mindustry/world/blocks/power/LongPowerNode.java +++ b/core/src/mindustry/world/blocks/power/LongPowerNode.java @@ -10,7 +10,7 @@ import mindustry.graphics.*; public class LongPowerNode extends PowerNode{ public @Load("@-glow") TextureRegion glow; - public Color glowColor = Color.valueOf("cbfd81").a(0.6f); + public Color glowColor = Color.valueOf("cbfd81").a(0.45f); public float glowScl = 16f, glowMag = 0.6f; public LongPowerNode(String name){