Skip to content

Commit

Permalink
Beam nodes now display graph status
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Nov 15, 2023
1 parent a836a64 commit 1a763a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/mindustry/world/blocks/power/BeamNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ public void updateTile(){

@Override
public BlockStatus status(){
if(Mathf.equal(power.status, 0f, 0.001f)) return BlockStatus.noInput;
if(Mathf.equal(power.status, 1f, 0.001f)) return BlockStatus.active;
return BlockStatus.noOutput;
float balance = power.graph.getPowerBalance();
if(balance > 0f) return BlockStatus.active;
if(balance < 0f && power.graph.getLastPowerStored() > 0) return BlockStatus.noOutput;
return BlockStatus.noInput;
}

@Override
Expand Down

0 comments on commit 1a763a5

Please sign in to comment.