This commit is contained in:
Anuken
2024-05-26 09:31:40 -04:00
parent 617d5581e0
commit f1f17965bc
5 changed files with 10 additions and 7 deletions

View File

@@ -66,7 +66,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
Time.setDeltaProvider(() -> { Time.setDeltaProvider(() -> {
float result = Core.graphics.getDeltaTime() * 60f; 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(); UI.loadColors();

View File

@@ -154,6 +154,8 @@ public class Vars implements Loadable{
public static final int maxModSubtitleLength = 40; public static final int maxModSubtitleLength = 40;
/** multicast group for discovery.*/ /** multicast group for discovery.*/
public static final String multicastGroup = "227.2.7.7"; 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 */ /** whether the graphical game client has loaded */
public static boolean clientLoaded = false; public static boolean clientLoaded = false;
/** max GL texture size */ /** max GL texture size */

View File

@@ -130,13 +130,13 @@ public class BlockIndexer{
data.turretTree.remove(build); data.turretTree.remove(build);
} }
//is no longer registered
build.wasDamaged = false;
//unregister damaged buildings //unregister damaged buildings
if(build.damaged() && damagedTiles[team.id] != null){ if(build.wasDamaged && damagedTiles[team.id] != null){
damagedTiles[team.id].remove(build); damagedTiles[team.id].remove(build);
} }
//is no longer registered
build.wasDamaged = false;
} }
} }

View File

@@ -1981,9 +1981,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
switch(prop){ switch(prop){
case health -> { case health -> {
health = (float)Mathf.clamp(value, 0, maxHealth); health = (float)Mathf.clamp(value, 0, maxHealth);
healthChanged();
if(health <= 0f && !dead()){ if(health <= 0f && !dead()){
Call.buildDestroyed(self()); Call.buildDestroyed(self());
}else{
healthChanged();
} }
} }
case team -> { case team -> {

View File

@@ -148,7 +148,7 @@ public class ServerControl implements ApplicationListener{
return useColors ? addColors(text) : removeColors(text); 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(); registerCommands();