Fixed units patrolling too quickly / Editor bugfixes

This commit is contained in:
Anuken
2019-03-16 13:25:50 -04:00
parent 91741ec29c
commit 22fadab3b3
4 changed files with 15 additions and 8 deletions
@@ -241,10 +241,14 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
return;
}
if(!isFlying() && (world.tileWorld(x, y) != null && world.tileWorld(x, y).solid())){
kill();
}
avoidOthers(1.25f);
if(spawner != noSpawner && (world.tile(spawner) == null || world.tile(spawner).entity == null)){
damage(health);
kill();
}
updateTargeting();
@@ -178,9 +178,9 @@ public abstract class GroundUnit extends BaseUnit{
}
protected void patrol(){
vec.trns(baseRotation, type.speed * Time.delta() * 2);
vec.trns(baseRotation, type.speed * Time.delta());
velocity.add(vec.x, vec.y);
vec.trns(baseRotation, type.hitsizeTile);
vec.trns(baseRotation, type.hitsizeTile * 3);
Tile tile = world.tileWorld(x + vec.x, y + vec.y);
if((tile == null || tile.solid() || tile.floor().drownTime > 0) || stuckTime > 10f){
baseRotation += Mathf.sign(id % 2 - 0.5f) * Time.delta() * 3f;