diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java index ae8aae4ab3..2a7b133588 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -66,7 +66,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform Time.setDeltaProvider(() -> { float result = Core.graphics.getDeltaTime() * 60f; - return (Float.isNaN(result) || Float.isInfinite(result)) ? 1f : Mathf.clamp(result, 0.0001f, 60f / 10f); + return (Float.isNaN(result) || Float.isInfinite(result)) ? 1f : Mathf.clamp(result, 0.0001f, maxDeltaClient); }); UI.loadColors(); diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 3538a39ce6..bc4c6a494a 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -154,6 +154,8 @@ public class Vars implements Loadable{ public static final int maxModSubtitleLength = 40; /** multicast group for discovery.*/ public static final String multicastGroup = "227.2.7.7"; + /** Maximum delta time. If the actual delta time (*60) between frames is higher than this number, the game will start to slow down. */ + public static float maxDeltaClient = 6f, maxDeltaServer = 10f; /** whether the graphical game client has loaded */ public static boolean clientLoaded = false; /** max GL texture size */ diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 60bcca661e..7f944a3eb0 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -130,13 +130,13 @@ public class BlockIndexer{ data.turretTree.remove(build); } - //is no longer registered - build.wasDamaged = false; - //unregister damaged buildings - if(build.damaged() && damagedTiles[team.id] != null){ + if(build.wasDamaged && damagedTiles[team.id] != null){ damagedTiles[team.id].remove(build); } + + //is no longer registered + build.wasDamaged = false; } } diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index f7c114ab6d..dad6e2464b 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1981,9 +1981,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, switch(prop){ case health -> { health = (float)Mathf.clamp(value, 0, maxHealth); - healthChanged(); if(health <= 0f && !dead()){ Call.buildDestroyed(self()); + }else{ + healthChanged(); } } case team -> { diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 6fba4a97e7..6716c1165b 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -148,7 +148,7 @@ public class ServerControl implements ApplicationListener{ return useColors ? addColors(text) : removeColors(text); }; - Time.setDeltaProvider(() -> Math.min(Core.graphics.getDeltaTime() * 60f, 10f)); + Time.setDeltaProvider(() -> Math.min(Core.graphics.getDeltaTime() * 60f, maxDeltaServer)); registerCommands();