Somewhat functional rule selection

This commit is contained in:
Anuken
2019-05-12 19:43:23 -04:00
parent 48ed4b0e49
commit 52f2b52990
6 changed files with 36 additions and 26 deletions

View File

@@ -642,7 +642,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
}
protected void updateFlying(){
if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity)target).damaged() && target.isValid() && ((TileEntity)target).isAdded() && target.getTeam() == team && mech.canHeal && dst(target) < getWeapon().bullet.range())){
if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity)target).damaged() && target.isValid() && target.getTeam() == team && mech.canHeal && dst(target) < getWeapon().bullet.range())){
target = null;
}

View File

@@ -296,6 +296,11 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
}
}
@Override
public boolean isValid(){
return !isDead() && tile.entity == this;
}
@Override
public EntityGroup targetGroup(){
return tileGroup;