mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 08:18:13 +07:00
MechPad deselect / Flyer patrol tweak
This commit is contained in:
@ -84,7 +84,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
||||
});
|
||||
|
||||
if(target != null){
|
||||
circle(60f + Mathf.absin(Time.time() + id * 23525, 70f, 1200f));
|
||||
circle(60f + Mathf.absin(Time.time() + Mathf.randomSeed(id) * 1200f, 70f, 1200f));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -76,8 +76,9 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
|
||||
@Override
|
||||
public void move(float x, float y){
|
||||
if(Mathf.dst(x, y) > 0.01f){
|
||||
baseRotation = Mathf.slerpDelta(baseRotation, Mathf.angle(x, y), type.baseRotateSpeed);
|
||||
float dst = Mathf.dst(x, y);
|
||||
if(dst > 0.01f){
|
||||
baseRotation = Mathf.slerp(baseRotation, Mathf.angle(x, y), type.baseRotateSpeed * (dst / type.speed));
|
||||
}
|
||||
super.move(x, y);
|
||||
}
|
||||
|
@ -8,8 +8,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.math.geom.Geometry;
|
||||
import io.anuke.arc.math.geom.Vector2;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Damage;
|
||||
@ -250,6 +249,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
||||
|
||||
final int rad = 2;
|
||||
|
||||
//TODO fix units getting trapped on tile corners
|
||||
moveVector.setZero();
|
||||
for(int cx = -rad; cx <= rad; cx++){
|
||||
for(int cy = -rad; cy <= rad; cy++){
|
||||
|
@ -126,7 +126,8 @@ public class MechPad extends Block{
|
||||
if(checkValidTap(tile, player)){
|
||||
Call.onMechFactoryTap(player, tile);
|
||||
}else if(player.isLocal && mobile && !player.isDead() && (entity.power.satisfaction >= requiredSatisfaction) && entity.player == null){
|
||||
player.moveTarget = tile.entity;
|
||||
//deselect on double taps
|
||||
player.moveTarget = player.moveTarget == tile.entity ? null : tile.entity;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,13 @@ public class ArcNetServer implements ServerProvider{
|
||||
Core.app.post(() -> {
|
||||
try{
|
||||
Net.handleServerReceived(k.id, object);
|
||||
}catch(ValidateException e){
|
||||
Log.err("Validation failed: {0} ({1})", e.player.name, e.getMessage());
|
||||
}catch(RuntimeException e){
|
||||
if(e.getCause() instanceof ValidateException){
|
||||
ValidateException v = (ValidateException)e.getCause();
|
||||
Log.err("Validation failed: {0} ({1})", v.player.name, v.getMessage());
|
||||
}else{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Reference in New Issue
Block a user