Browse Source

Added sanity check for empty power list.

master
MagicBot 2 years ago
parent
commit
867fdee328
  1. 5
      src/engine/ai/MobileFSM.java

5
src/engine/ai/MobileFSM.java

@ -1677,6 +1677,11 @@ public class MobileFSM {
powerTokens.removeAll(purgeTokens); powerTokens.removeAll(purgeTokens);
// Sanity check
if (powerTokens.isEmpty())
return false;
// Pick random spell from our list of powers // Pick random spell from our list of powers
int powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size())); int powerToken = powerTokens.get(ThreadLocalRandom.current().nextInt(powerTokens.size()));

Loading…
Cancel
Save