From 0889da2bc7fb4102b71d747d615614391a45f9c0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 14 Sep 2024 21:34:27 -0400 Subject: [PATCH] Minor arrival fixes for enter payload command --- core/src/mindustry/ai/types/CommandAI.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/types/CommandAI.java b/core/src/mindustry/ai/types/CommandAI.java index 0a90db901d..b9a77a544a 100644 --- a/core/src/mindustry/ai/types/CommandAI.java +++ b/core/src/mindustry/ai/types/CommandAI.java @@ -218,8 +218,13 @@ public class CommandAI extends AIController{ vecMovePos.add(group.positions[groupIndex * 2], group.positions[groupIndex * 2 + 1]); } + Building targetBuild = world.buildWorld(targetPos.x, targetPos.y); + //TODO: should the unit stop when it finds a target? - if(stance == UnitStance.patrol && target != null && unit.within(target, unit.type.range - 2f) && !unit.type.circleTarget){ + if( + (stance == UnitStance.patrol && target != null && unit.within(target, unit.type.range - 2f) && !unit.type.circleTarget) || + (command == UnitCommand.enterPayloadCommand && unit.within(targetPos, 4f) || (targetBuild != null && unit.within(targetBuild, targetBuild.block.size * tilesize/2f * 0.9f))) + ){ move = false; }