From 2469cf0851dbfcf29f9bad5049e6fa131cebcca3 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 19 Oct 2021 12:13:29 -0400 Subject: [PATCH] Added isPayload utility for buildings --- core/src/mindustry/entities/comp/BuildingComp.java | 5 +++++ core/src/mindustry/world/blocks/power/PowerNode.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index d5956282d3..9bef6370c7 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -978,6 +978,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } } + /** @return whether this building is in a payload */ + public boolean isPayload(){ + return tile == emptyTile; + } + /** * Called when a block is placed over some other blocks. This seq will always have at least one item. * Should load some previous state, if necessary. */ diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index cd88084f34..4c59a84174 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -444,7 +444,7 @@ public class PowerNode extends PowerBlock{ public void draw(){ super.draw(); - if(Mathf.zero(Renderer.laserOpacity) || tile == emptyTile) return; + if(Mathf.zero(Renderer.laserOpacity) || isPayload()) return; Draw.z(Layer.power); setupColor(power.graph.getSatisfaction());