From 77911385e11c058329740cf5fa53919272de04ec Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 24 Aug 2020 21:21:31 -0400 Subject: [PATCH] Fixed ground units walking into exclusion zone --- core/src/mindustry/ai/types/GroundAI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/types/GroundAI.java b/core/src/mindustry/ai/types/GroundAI.java index 6fee422ebf..d7b112554e 100644 --- a/core/src/mindustry/ai/types/GroundAI.java +++ b/core/src/mindustry/ai/types/GroundAI.java @@ -25,7 +25,14 @@ public class GroundAI extends AIController{ } 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){