From bb144185a12ed6797d0bfa507e9b6eab4fa84ce9 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:54:55 -0800 Subject: [PATCH] Skip propagation if unnecessary --- .../world/blocks/power/PowerGenerator.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 028a2739fe..20d59c6f59 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -141,25 +141,27 @@ public class PowerGenerator extends PowerDistributor{ Damage.damage(x, y, explosionRadius * tilesize, explosionDamage); } - Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { - Tile t = Vars.world.tile(tx, ty); - float dst = Mathf.dst(tileX(), tileY(), tx, ty); + if(explosionIgnitionChance > 0 || explosionBreaksProps){ + Geometry.circle(tileX(), tileY(), explosionRadius, (tx, ty) -> { + Tile t = Vars.world.tile(tx, ty); + float dst = Mathf.dst(tileX(), tileY(), tx, ty); - //Create fires - if(explosionIgnitionChance > 0 && - Mathf.chance(explosionIgnitionChance * - (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1)) - ){ - Time.run(dst / explosionSpeed, () -> { - Fires.create(t); - }); - } + //Create fires + if(explosionIgnitionChance > 0 && + Mathf.chance(explosionIgnitionChance * + (explosionScaleIgnitionChance ? 1 - Mathf.sqrt(dst / explosionRadius) : 1)) + ){ + Time.run(dst / explosionSpeed, () -> { + Fires.create(t); + }); + } - //Break boulders - if(explosionBreaksProps && t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator - ConstructBlock.deconstructFinish(t, t.block(), null); - } - }); + //Break boulders + if(explosionBreaksProps && t != null && t.block().unitMoveBreakable){ //Probably a good enough indicator + ConstructBlock.deconstructFinish(t, t.block(), null); + } + }); + } explodeEffect.at(this); explodeSound.at(this);