From 332b1ce1005bcc0c57bf19e13d57f696baff2a3d Mon Sep 17 00:00:00 2001 From: MEEP of Faith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 28 Mar 2021 15:40:47 -0700 Subject: [PATCH] `collidesGround` targetting in `GroundAI` (#4911) --- core/src/mindustry/ai/types/GroundAI.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/types/GroundAI.java b/core/src/mindustry/ai/types/GroundAI.java index b19d0e52aa..5a9db8db6a 100644 --- a/core/src/mindustry/ai/types/GroundAI.java +++ b/core/src/mindustry/ai/types/GroundAI.java @@ -21,7 +21,11 @@ public class GroundAI extends AIController{ if(core != null && unit.within(core, unit.range() / 1.1f + core.block.size * tilesize / 2f)){ target = core; - Arrays.fill(targets, core); + for(int i = 0; i < targets.length; i++){ + if(unit.mounts[i].weapon.bullet.collidesGround){ + targets[i] = core; + } + } } if((core == null || !unit.within(core, unit.range() * 0.5f)) && command() == UnitCommand.attack){