diff --git a/core/src/mindustry/ai/types/GroundAI.java b/core/src/mindustry/ai/types/GroundAI.java index ac2c110c12..1775b7b7e2 100644 --- a/core/src/mindustry/ai/types/GroundAI.java +++ b/core/src/mindustry/ai/types/GroundAI.java @@ -1,5 +1,6 @@ package mindustry.ai.types; +import arc.math.*; import mindustry.ai.Pathfinder.*; import mindustry.entities.*; import mindustry.entities.units.*; @@ -28,6 +29,10 @@ public class GroundAI extends AIController{ } } + if(unit.type().canBoost){ + unit.elevation = Mathf.approachDelta(unit.elevation, 0f, 0.08f); + } + if(!Units.invalidateTarget(target, unit, unit.range())){ if(unit.type().hasWeapons()){ unit.aimLook(Predict.intercept(unit, target, unit.type().weapons.first().bullet.speed)); diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index db938323da..cdb42c9864 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -559,6 +559,22 @@ public class NetClient implements ApplicationListener{ //limit to 10 to prevent buffer overflows int usedRequests = Math.min(player.builder().plans().size, 10); + int totalLength = 0; + + //prevent buffer overflow by checking config length + for(int i = 0; i < usedRequests; i++){ + BuildPlan plan = player.builder().plans().get(i); + if(plan.config instanceof byte[]){ + int length = ((byte[])plan.config).length; + totalLength += length; + } + + if(totalLength > 2048){ + usedRequests = i + 1; + break; + } + } + requests = new BuildPlan[usedRequests]; for(int i = 0; i < usedRequests; i++){ requests[i] = player.builder().plans().get(i); diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index d204e264d3..9e83f8dc03 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -614,7 +614,7 @@ public class NetServer implements ApplicationListener{ Unit unit = player.unit(); long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime); - float maxSpeed = (boosting ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed; + float maxSpeed = ((player.unit().type().canBoost && player.unit().isFlying()) ? player.unit().type().boostMultiplier : 1f) * player.unit().type().speed; if(unit.isGrounded()){ maxSpeed *= unit.floorSpeedMultiplier(); } diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 0f289328d0..11ed794a4a 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -75,9 +75,13 @@ public class Administration{ addActionFilter(action -> { if(action.type != ActionType.breakBlock && action.type != ActionType.placeBlock && - Config.antiSpam.bool() && - //make sure players can configure their own stuff, e.g. in schematics - lastPlaced.get(action.tile.pos(), -1) != action.player.id()){ + Config.antiSpam.bool()){ + + //make sure players can configure their own stuff, e.g. in schematics - but only once. + if(lastPlaced.get(action.tile.pos(), -1) == action.player.id()){ + lastPlaced.remove(action.tile.pos()); + return true; + } Ratekeeper rate = action.player.getInfo().rate; if(rate.allow(Config.interactRateWindow.num() * 1000, Config.interactRateLimit.num())){ diff --git a/core/src/mindustry/ui/dialogs/ResearchDialog.java b/core/src/mindustry/ui/dialogs/ResearchDialog.java index fd7bbf0c86..8fc2c387c7 100644 --- a/core/src/mindustry/ui/dialogs/ResearchDialog.java +++ b/core/src/mindustry/ui/dialogs/ResearchDialog.java @@ -233,7 +233,7 @@ public class ResearchDialog extends BaseDialog{ } boolean selectable(TechNode node){ - return !node.objectives.contains(i -> !i.complete()); + return node.content.unlocked() || !node.objectives.contains(i -> !i.complete()); } void showToast(String info){ diff --git a/gradle.properties b/gradle.properties index 213f452ee6..f4f9071b07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=1040fdcbb5760e4c4a646d64782a25761efc1159 +archash=b06edb6b57c0e6247c1856c507a33fb8b64656e7