From 18c669ae3eafab0f153b2e95bad862f72e5aaf0b Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 6 Mar 2021 14:23:10 -0500 Subject: [PATCH] Fixed #4879 / Fixed server speed validation check --- core/src/mindustry/core/NetServer.java | 3 --- core/src/mindustry/entities/comp/CommanderComp.java | 3 ++- core/src/mindustry/entities/comp/PlayerComp.java | 4 ++++ core/src/mindustry/mod/ContentParser.java | 1 + gradle.properties | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index bead4b8a92..92509ec2e8 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -656,9 +656,6 @@ public class NetServer implements ApplicationListener{ long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime); float maxSpeed = unit.realSpeed(); - if(unit.isGrounded()){ - maxSpeed *= unit.floorSpeedMultiplier(); - } float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.2f; diff --git a/core/src/mindustry/entities/comp/CommanderComp.java b/core/src/mindustry/entities/comp/CommanderComp.java index 2842e5cc9c..92a86e12c2 100644 --- a/core/src/mindustry/entities/comp/CommanderComp.java +++ b/core/src/mindustry/entities/comp/CommanderComp.java @@ -4,6 +4,7 @@ import arc.func.*; import arc.math.geom.*; import arc.struct.*; import arc.util.*; +import mindustry.*; import mindustry.ai.formations.*; import mindustry.ai.types.*; import mindustry.annotations.Annotations.*; @@ -29,7 +30,7 @@ abstract class CommanderComp implements Entityc, Posc{ transient float minFormationSpeed; public void update(){ - if(controlling.isEmpty()){ + if(controlling.isEmpty() && !Vars.net.client()){ formation = null; } diff --git a/core/src/mindustry/entities/comp/PlayerComp.java b/core/src/mindustry/entities/comp/PlayerComp.java index ccfa3089ba..a44c8d0ff4 100644 --- a/core/src/mindustry/entities/comp/PlayerComp.java +++ b/core/src/mindustry/entities/comp/PlayerComp.java @@ -110,8 +110,12 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra unit.aim(mouseX, mouseY); //this is only necessary when the thing being controlled isn't synced unit.controlWeapons(shooting, shooting); + //save previous formation to prevent reset + var formation = unit.formation; //extra precaution, necessary for non-synced things unit.controller(this); + //keep previous formation + unit.formation = formation; } @Override diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 257b20188a..11bd9d0416 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -436,6 +436,7 @@ public class ContentParser{ try{ run.run(); }catch(Throwable t){ + Log.err(t); //don't overwrite double errors markError(currentContent, t); } diff --git a/gradle.properties b/gradle.properties index 90a92974a5..5010365e45 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=d1e1f3fe8803c6688182301cbf61b1bcfe39160a +archash=e318a6e39bf0497df62b2b3110dc24692d993d33