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

View File

@@ -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;

View File

@@ -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){