Merge branch 'master' into 'master'

fix divided allocation

See merge request core-developers/forge!4605
This commit is contained in:
Anthony Calosa
2021-04-26 20:01:36 +00:00

View File

@@ -866,6 +866,7 @@ public class CountersPutAi extends SpellAbilityAi {
choice = Aggregates.random(list); choice = Aggregates.random(list);
} }
} }
}
if (choice != null && divided) { if (choice != null && divided) {
int alloc = Math.max(amount / totalTargets, 1); int alloc = Math.max(amount / totalTargets, 1);
if (sa.getTargets().size() == Math.min(totalTargets, sa.getMaxTargets()) - 1) { if (sa.getTargets().size() == Math.min(totalTargets, sa.getMaxTargets()) - 1) {
@@ -875,8 +876,6 @@ public class CountersPutAi extends SpellAbilityAi {
left -= alloc; left -= alloc;
} }
} }
}
if (choice != null) { if (choice != null) {
sa.getTargets().add(choice); sa.getTargets().add(choice);
list.remove(choice); list.remove(choice);