mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Fix shard sort order when deciding if a mana cost is payable.
Prior to this change, the logic would conclude that a {1}{W} cost is not payable with an untapped Scoured Barrens (w/b) and Jungle Hollow (b/g) on the field.
The code is unfortunately too tangled (has too many dependencies) to write a unit test for this. Ideally, we should refactor so it wouldn't depend on the player, etc and just take parameters that can be fed test data.
This commit is contained in:
@@ -697,11 +697,7 @@ public class ComputerUtilMana {
|
||||
// * pay hybrids
|
||||
// * pay phyrexian, keep mana for colorless
|
||||
// * pay colorless
|
||||
Iterator<ManaCostShard> shards = cost.getDistinctShards().iterator();
|
||||
if (shards.hasNext()) {
|
||||
return shards.next();
|
||||
}
|
||||
return null;
|
||||
return cost.getShardToPayByPriority(cost.getDistinctShards(), MagicColor.ALL_COLORS);
|
||||
}
|
||||
|
||||
private static void adjustManaCostToAvoidNegEffects(ManaCostBeingPaid cost, final Card card, Player ai) {
|
||||
|
||||
Reference in New Issue
Block a user