Fixed #4879 / Fixed server speed validation check
This commit is contained in:
@@ -656,9 +656,6 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime);
|
long elapsed = Time.timeSinceMillis(con.lastReceivedClientTime);
|
||||||
float maxSpeed = unit.realSpeed();
|
float maxSpeed = unit.realSpeed();
|
||||||
if(unit.isGrounded()){
|
|
||||||
maxSpeed *= unit.floorSpeedMultiplier();
|
|
||||||
}
|
|
||||||
|
|
||||||
float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.2f;
|
float maxMove = elapsed / 1000f * 60f * maxSpeed * 1.2f;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import arc.func.*;
|
|||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.*;
|
||||||
import mindustry.ai.formations.*;
|
import mindustry.ai.formations.*;
|
||||||
import mindustry.ai.types.*;
|
import mindustry.ai.types.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
@@ -29,7 +30,7 @@ abstract class CommanderComp implements Entityc, Posc{
|
|||||||
transient float minFormationSpeed;
|
transient float minFormationSpeed;
|
||||||
|
|
||||||
public void update(){
|
public void update(){
|
||||||
if(controlling.isEmpty()){
|
if(controlling.isEmpty() && !Vars.net.client()){
|
||||||
formation = null;
|
formation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,8 +110,12 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
|||||||
unit.aim(mouseX, mouseY);
|
unit.aim(mouseX, mouseY);
|
||||||
//this is only necessary when the thing being controlled isn't synced
|
//this is only necessary when the thing being controlled isn't synced
|
||||||
unit.controlWeapons(shooting, shooting);
|
unit.controlWeapons(shooting, shooting);
|
||||||
|
//save previous formation to prevent reset
|
||||||
|
var formation = unit.formation;
|
||||||
//extra precaution, necessary for non-synced things
|
//extra precaution, necessary for non-synced things
|
||||||
unit.controller(this);
|
unit.controller(this);
|
||||||
|
//keep previous formation
|
||||||
|
unit.formation = formation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -436,6 +436,7 @@ public class ContentParser{
|
|||||||
try{
|
try{
|
||||||
run.run();
|
run.run();
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
|
Log.err(t);
|
||||||
//don't overwrite double errors
|
//don't overwrite double errors
|
||||||
markError(currentContent, t);
|
markError(currentContent, t);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=d1e1f3fe8803c6688182301cbf61b1bcfe39160a
|
archash=e318a6e39bf0497df62b2b3110dc24692d993d33
|
||||||
|
|||||||
Reference in New Issue
Block a user