From b327f8be1f57355104afcad06d471c6bb11b1ce9 Mon Sep 17 00:00:00 2001 From: WMF <87574232+WMF-Industries@users.noreply.github.com> Date: Thu, 10 Jul 2025 04:31:05 +0200 Subject: [PATCH] update applySlowdown correctly (#11003) --- core/src/mindustry/entities/comp/BuildingComp.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index d048e8602d..3f92bc114d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -438,17 +438,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return heat; } + /** Sets the time scale of the building to the given intensity, unless it's above that value */ public void applyBoost(float intensity, float duration){ - //do not refresh time scale when getting a weaker intensity + //do not refresh time scale when getting a lower intensity if(intensity >= this.timeScale - 0.001f){ timeScaleDuration = Math.max(timeScaleDuration, duration); } timeScale = Math.max(timeScale, intensity); } + /** Sets the time scale of the building to the given intensity, unless it's below that value */ public void applySlowdown(float intensity, float duration){ - //do not refresh time scale when getting a weaker intensity - if(intensity <= this.timeScale - 0.001f){ + //do not refresh time scale when getting a higher intensity + if(intensity <= this.timeScale + 0.001f){ timeScaleDuration = Math.max(timeScaleDuration, duration); } timeScale = Math.min(timeScale, intensity);