From 48a5ae443fa9f3d9e49d4d836465ab85f77846b5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 27 Sep 2022 11:57:11 -0400 Subject: [PATCH] Fixed #7633 --- core/src/mindustry/entities/Damage.java | 2 -- core/src/mindustry/ui/LiquidDisplay.java | 2 +- .../world/blocks/production/GenericCrafter.java | 13 +++++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 70b5e40ccd..b7285392e5 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -507,9 +507,7 @@ public class Damage{ } public static void tileDamage(Team team, int x, int y, float baseRadius, float damage, @Nullable Bullet source){ - Core.app.post(() -> { - var in = world.build(x, y); //spawned inside a multiblock. this means that damage needs to be dealt directly. //why? because otherwise the building would absorb everything in one cell, which means much less damage than a nearby explosion. diff --git a/core/src/mindustry/ui/LiquidDisplay.java b/core/src/mindustry/ui/LiquidDisplay.java index 416a865336..d0982374ab 100644 --- a/core/src/mindustry/ui/LiquidDisplay.java +++ b/core/src/mindustry/ui/LiquidDisplay.java @@ -21,7 +21,7 @@ public class LiquidDisplay extends Table{ this.perSecond = perSecond; add(new Stack(){{ - add(new Image(liquid.uiIcon)); + add(new Image(liquid.uiIcon).setScaling(Scaling.fit)); if(amount != 0){ Table t = new Table().left().bottom(); diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index 4a9b65f9b8..fd4e76a9d8 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -237,6 +237,19 @@ public class GenericCrafter extends Block{ dumpOutputs(); } + @Override + public float getProgressIncrease(float baseTime){ + //limit progress increase by maximum amount of liquid it can produce + float scaling = 1f; + if(outputLiquids != null){ + for(var s : outputLiquids){ + scaling = Math.min(scaling, (liquidCapacity - liquids.get(s.liquid)) / (s.amount * edelta())); + } + } + + return super.getProgressIncrease(baseTime) * scaling; + } + public float warmupTarget(){ return 1f; }