Mobile manual aiming / Mobile control changes [UNSTABLE]
This commit is contained in:
@@ -67,13 +67,11 @@ public class BuilderAI extends AIController{
|
||||
Units.nearby(unit.team, unit.x, unit.y, buildRadius, u -> {
|
||||
if(found) return;
|
||||
|
||||
if(u instanceof Builderc && u != unit && ((Builderc)u).activelyBuilding()){
|
||||
Builderc b = (Builderc)u;
|
||||
if(u instanceof Builderc b && u != unit && ((Builderc)u).activelyBuilding()){
|
||||
BuildPlan plan = b.buildPlan();
|
||||
|
||||
Building build = world.build(plan.x, plan.y);
|
||||
if(build instanceof ConstructBuild){
|
||||
ConstructBuild cons = (ConstructBuild)build;
|
||||
if(build instanceof ConstructBuild cons){
|
||||
float dist = Math.min(cons.dst(unit) - buildingRange, 0);
|
||||
|
||||
//make sure you can reach the request in time
|
||||
|
||||
@@ -17,9 +17,7 @@ public class MinerAI extends AIController{
|
||||
protected void updateMovement(){
|
||||
Building core = unit.closestCore();
|
||||
|
||||
if(!(unit instanceof Minerc) || core == null) return;
|
||||
|
||||
Minerc miner = (Minerc)unit;
|
||||
if(!(unit instanceof Minerc miner) || core == null) return;
|
||||
|
||||
if(miner.mineTile() != null && !miner.mineTile().within(unit, unit.type().range)){
|
||||
miner.mineTile(null);
|
||||
|
||||
Reference in New Issue
Block a user