Unit factory limit / Removed overdrive block effects / BlockFlag cleanup
This commit is contained in:
@@ -129,11 +129,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
||||
@Override
|
||||
public boolean collidesGrid(int x, int y){
|
||||
Tile tile = world.tile(x, y);
|
||||
if(!isFlying()) return true;
|
||||
if(!mech.flying && tile != null && !tile.block().synthetic() && tile.block().solid){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !isFlying() || (!mech.flying && tile != null && !tile.block().synthetic() && tile.block().solid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -120,8 +120,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
}
|
||||
|
||||
public boolean targetHasFlag(BlockFlag flag){
|
||||
return target instanceof TileEntity && ((TileEntity) target).tile.block().flags != null &&
|
||||
((TileEntity) target).tile.block().flags.contains(flag);
|
||||
return target instanceof TileEntity && ((TileEntity) target).tile.block().flags.contains(flag);
|
||||
}
|
||||
|
||||
public void updateRespawning(){
|
||||
@@ -324,6 +323,11 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
|
||||
@Override
|
||||
public void removed(){
|
||||
Tile tile = world.tile(spawner);
|
||||
if(tile != null){
|
||||
tile.block().unitRemoved(tile, this);
|
||||
}
|
||||
|
||||
spawner = noSpawner;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user