mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
avoid CME in chooseSaToActivateFromOpeningHand()
Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
@@ -1484,22 +1484,24 @@ public class AiController {
|
|||||||
boolean hasLeyline1 = false;
|
boolean hasLeyline1 = false;
|
||||||
SpellAbility saGemstones = null;
|
SpellAbility saGemstones = null;
|
||||||
|
|
||||||
for(int i = 0; i < result.size(); i++) {
|
List<SpellAbility> toRemove = Lists.newArrayList();
|
||||||
SpellAbility sa = result.get(i);
|
for(SpellAbility sa : result) {
|
||||||
|
|
||||||
String srcName = sa.getHostCard().getName();
|
String srcName = sa.getHostCard().getName();
|
||||||
if ("Gemstone Caverns".equals(srcName)) {
|
if ("Gemstone Caverns".equals(srcName)) {
|
||||||
if (saGemstones == null)
|
if (saGemstones == null)
|
||||||
saGemstones = sa;
|
saGemstones = sa;
|
||||||
else
|
else
|
||||||
result.remove(i--);
|
toRemove.add(sa);
|
||||||
} else if ("Leyline of Singularity".equals(srcName)) {
|
} else if ("Leyline of Singularity".equals(srcName)) {
|
||||||
if (!hasLeyline1)
|
if (!hasLeyline1)
|
||||||
hasLeyline1 = true;
|
hasLeyline1 = true;
|
||||||
else
|
else
|
||||||
result.remove(i--);
|
toRemove.add(sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(SpellAbility sa : toRemove) {
|
||||||
|
result.remove(sa);
|
||||||
|
}
|
||||||
|
|
||||||
// Play them last
|
// Play them last
|
||||||
if (saGemstones != null) {
|
if (saGemstones != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user