Fixed ground units walking into exclusion zone

This commit is contained in:
Anuken 2020-08-24 21:21:31 -04:00
parent b207d05d4b
commit 77911385e1

View File

@ -25,7 +25,14 @@ public class GroundAI extends AIController{
} }
if((core == null || !unit.within(core, unit.range() * 0.5f)) && command() == UnitCommand.attack){ if((core == null || !unit.within(core, unit.range() * 0.5f)) && command() == UnitCommand.attack){
moveToCore(FlagTarget.enemyCores); boolean move = true;
if(state.rules.waves && unit.team == state.rules.defaultTeam){
Tile spawner = getClosestSpawner();
if(spawner != null && unit.within(spawner, state.rules.dropZoneRadius + 120f)) move = false;
}
if(move) moveToCore(FlagTarget.enemyCores);
} }
if(command() == UnitCommand.rally){ if(command() == UnitCommand.rally){