From fc5e40a85763cda9e134170adf6404a951d1c372 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 11 Jul 2022 21:57:53 -0400 Subject: [PATCH] Crash fix --- core/src/mindustry/ai/RtsAI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/RtsAI.java b/core/src/mindustry/ai/RtsAI.java index 8660cbb10b..1d0befd241 100644 --- a/core/src/mindustry/ai/RtsAI.java +++ b/core/src/mindustry/ai/RtsAI.java @@ -174,7 +174,7 @@ public class RtsAI{ //defend when close, or this is the only squad defending //TODO will always rush to defense no matter what - if(best instanceof CoreBuild || units.size >= data.team.rules().rtsMinSquad || best.within(ax, ay, 500f)){ + if(best != null && (best instanceof CoreBuild || units.size >= data.team.rules().rtsMinSquad || best.within(ax, ay, 500f))){ defend = best; if(debug){