Fixed beam-to-node connections

This commit is contained in:
Anuken
2022-02-07 14:40:13 -05:00
parent 271e19f63f
commit 77410ce106
2 changed files with 4 additions and 3 deletions
@@ -61,7 +61,7 @@ public class BeamNode extends PowerBlock{
int offset = size/2; int offset = size/2;
for(int j = 1 + offset; j <= range + offset; j++){ for(int j = 1 + offset; j <= range + offset; j++){
var other = world.build(x + j * dir.x, y + j * dir.y); 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; maxLen = j;
dest = other; dest = other;
break; break;
@@ -145,7 +145,8 @@ public class BeamNode extends PowerBlock{
//find first block with power in range //find first block with power in range
for(int j = 1 + offset; j <= range + offset; j++){ for(int j = 1 + offset; j <= range + offset; j++){
var other = world.build(tile.x + j * dir.x, tile.y + j * dir.y); 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; links[i] = other;
dests[i] = world.tile(tile.x + j * dir.x, tile.y + j * dir.y); dests[i] = world.tile(tile.x + j * dir.x, tile.y + j * dir.y);
break; break;
@@ -10,7 +10,7 @@ import mindustry.graphics.*;
public class LongPowerNode extends PowerNode{ public class LongPowerNode extends PowerNode{
public @Load("@-glow") TextureRegion glow; 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 float glowScl = 16f, glowMag = 0.6f;
public LongPowerNode(String name){ public LongPowerNode(String name){