CardUtil overflow

This commit is contained in:
Zzooouhh 2017-12-23 23:34:00 +01:00 committed by GitHub
parent ae6eb7f19e
commit efe2331ec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,7 @@ import mage.filter.FilterObject;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.players.Player;
import mage.target.TargetSource;
import mage.util.CardUtil;
/**
*
@ -129,7 +130,7 @@ class DesperateGambitEffect extends PreventionEffectImpl {
if (controller != null && object != null) {
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
if (wonFlip) {
event.setAmount(game.addWithOverflowCheck(event.getAmount(), event.getAmount()));
event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount()));
this.discard();
} else {
preventDamageAction(event, source, game);