More multiplayer fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.func.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.QuadTree.*;
|
||||
import arc.math.geom.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
@@ -48,6 +49,14 @@ abstract class HitboxComp implements Posc, QuadTreeObject{
|
||||
return y - lastY;
|
||||
}
|
||||
|
||||
float deltaLen(){
|
||||
return Mathf.len(deltaX(), deltaY());
|
||||
}
|
||||
|
||||
float deltaAngle(){
|
||||
return Mathf.angle(deltaX(), deltaY());
|
||||
}
|
||||
|
||||
boolean collides(Hitboxc other){
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
float len = vel().len();
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
float len = deltaLen();
|
||||
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
walkTime += Time.delta()*len;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user