From 867fdee3285c1b347b9cc8cdf1786adc46496e50 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 15 Mar 2023 10:11:01 -0400 Subject: [PATCH] Added sanity check for empty power list. --- src/engine/ai/MobileFSM.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index 809ac396..dc648faf 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -1677,6 +1677,11 @@ public class MobileFSM { powerTokens.removeAll(purgeTokens); + // Sanity check + + if (powerTokens.isEmpty()) + return false; + // Pick random spell from our list of powers int powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size()));