mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Fix index out of bounds with multiple targets.
This commit is contained in:
@@ -40,7 +40,7 @@ public class PossibleTargetSelector {
|
||||
}
|
||||
sa.resetTargets();
|
||||
int index = targetIndex;
|
||||
while (sa.getTargets().getNumTargeted() < tgt.getMaxTargets(sa.getHostCard(), sa)) {
|
||||
while (sa.getTargets().getNumTargeted() < tgt.getMaxTargets(sa.getHostCard(), sa) && index < validTargets.size()) {
|
||||
sa.getTargets().add(validTargets.get(index++));
|
||||
}
|
||||
// TODO: smarter about multiple targets, identical targets, etc...
|
||||
|
||||
Reference in New Issue
Block a user