From abdb1c12528bbf3eb97b9b52edbaba9c1b804673 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 24 Apr 2022 14:11:21 -0400 Subject: [PATCH] "Hugging" fix for RTS AI --- core/src/mindustry/ai/RtsAI.java | 2 +- core/src/mindustry/ai/types/CommandAI.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ai/RtsAI.java b/core/src/mindustry/ai/RtsAI.java index 97368ffd65..61e5d81e03 100644 --- a/core/src/mindustry/ai/RtsAI.java +++ b/core/src/mindustry/ai/RtsAI.java @@ -224,7 +224,7 @@ public class RtsAI{ unit.command().commandPosition(defendPos); }else{ //TODO stopAtTarget parameter could be false, could be tweaked - unit.command().commandTarget(defendTarget == null ? build : defendTarget, true); + unit.command().commandTarget(defendTarget == null ? build : defendTarget, defendTarget != null); } } } diff --git a/core/src/mindustry/ai/types/CommandAI.java b/core/src/mindustry/ai/types/CommandAI.java index a9e2c2ac7c..216370ae82 100644 --- a/core/src/mindustry/ai/types/CommandAI.java +++ b/core/src/mindustry/ai/types/CommandAI.java @@ -82,7 +82,7 @@ public class CommandAI extends AIController{ attackTarget != null && unit.within(attackTarget, engageRange) ? engageRange : unit.isGrounded() ? 0f : attackTarget != null ? engageRange : - 0f, 100f, false, null); + 0f, unit.isFlying() ? 40f : 100f, false, null); //calculateFlock().limit(unit.speed() * flockMult) }