Fixed #4879 / Fixed server speed validation check

This commit is contained in:
Anuken 2021-03-06 14:23:10 -05:00
parent 7c7c57c64e
commit 18c669ae3e
5 changed files with 8 additions and 5 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -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

View file

@ -436,6 +436,7 @@ public class ContentParser{
try{
run.run();
}catch(Throwable t){
Log.err(t);
//don't overwrite double errors
markError(currentContent, t);
}

View file

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=d1e1f3fe8803c6688182301cbf61b1bcfe39160a
archash=e318a6e39bf0497df62b2b3110dc24692d993d33