Fixed pathfinding using water / Fixed mech factories moving too fast

This commit is contained in:
Anuken
2018-07-05 13:38:42 -04:00
parent 4fa165bc6a
commit 8c6cda0d97
5 changed files with 14 additions and 9 deletions
@@ -441,6 +441,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
boostHeat = 0f;
updateRespawning();
return;
}else{
spawner = -1;
}
if(!isLocal){
@@ -667,11 +669,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
}
public void updateRespawning(){
CoreEntity entity = (CoreEntity)getClosestCore();
if (entity != null) {
this.spawner = entity.tile.id();
entity.updateSpawning(this);
if (spawner != -1 && world.tile(spawner) != null && world.tile(spawner).entity instanceof SpawnerTrait) {
((SpawnerTrait) world.tile(spawner).entity).updateSpawning(this);
}else{
CoreEntity entity = (CoreEntity)getClosestCore();
if(entity != null){
this.spawner = entity.tile.id();
}
}
}