mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed PayEnergyCost.pay to check counters amount available.
This commit is contained in:
parent
aa661e6ac3
commit
18e771ccd5
1 changed files with 84 additions and 85 deletions
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.costs.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -63,7 +62,7 @@ public class PayEnergyCost extends CostImpl {
|
|||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
Player player = game.getPlayer(controllerId);
|
||||
if (player != null) {
|
||||
if (player != null && player.getCounters().getCount(CounterType.ENERGY) >= amount) {
|
||||
player.getCounters().removeCounter(CounterType.ENERGY, amount);
|
||||
paid = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue