- Fixed Donate AI crashing if all opponents have hexproof.

This commit is contained in:
Agetian
2017-06-22 19:53:21 +00:00
parent 8942419d6c
commit 2097d2207b

View File

@@ -165,6 +165,11 @@ public class SpecialCardAi {
oppTarget = oppList; oppTarget = oppList;
} }
// All opponents have hexproof or something like that
if (Iterables.isEmpty(oppList)) {
return false;
}
// select player with less lands on the field (helpful for Illusions of Grandeur and probably Pacts too) // select player with less lands on the field (helpful for Illusions of Grandeur and probably Pacts too)
Player opp = Collections.min(Lists.newArrayList(oppTarget), Player opp = Collections.min(Lists.newArrayList(oppTarget),
PlayerPredicates.compareByZoneSize(ZoneType.Battlefield, CardPredicates.Presets.LANDS)); PlayerPredicates.compareByZoneSize(ZoneType.Battlefield, CardPredicates.Presets.LANDS));