From 23fb15fe78ded180d20f13221d54b2432b739428 Mon Sep 17 00:00:00 2001 From: Timmeey86 Date: Fri, 14 Dec 2018 21:14:19 +0100 Subject: [PATCH] Buffered consumers will no longer have their buffer reset when being unlinked --- .../io/anuke/mindustry/world/blocks/power/PowerGraph.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java index 45311afcd5..3cbf21c096 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerGraph.java @@ -181,7 +181,10 @@ public class PowerGraph{ public void clear(){ for(Tile other : all){ if(other.entity != null && other.entity.power != null){ - other.entity.power.satisfaction = 0.0f; + if(other.block().consumes.hasSubtypeOf(ConsumePower.class) && !other.block().consumes.getSubtypeOf(ConsumePower.class).isBuffered){ + // Reset satisfaction to zero in case of direct consumer. There is no reason to clear power from buffered consumers. + other.entity.power.satisfaction = 0.0f; + } other.entity.power.graph = null; } }