mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fabricate: if the only option is to create servo tokens, just do that. Avoids IndexOutOfBoundsException.
This commit is contained in:
@@ -236,6 +236,12 @@ public class ChooseGenericEffectAi extends SpellAbilityAi {
|
||||
return Aggregates.random(spells);
|
||||
} else if (logic.startsWith("Fabricate")) {
|
||||
final int n = Integer.valueOf(logic.substring("Fabricate".length()));
|
||||
if(spells.size() < 2) {
|
||||
// If the creature is no longer on the battlefield, the option
|
||||
// to add counters is already removed at this point. Return the
|
||||
// only available option: create servo tokens.
|
||||
return spells.get(0);
|
||||
}
|
||||
SpellAbility counterSA = spells.get(0), tokenSA = spells.get(1);
|
||||
|
||||
// check for something which might prevent the counters to be placed on host
|
||||
|
||||
Reference in New Issue
Block a user