CardUtil overflow

This commit is contained in:
Zzooouhh 2017-12-23 23:41:44 +01:00 committed by GitHub
parent 8acc38e24c
commit 8ea40bc385
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,7 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
* @author noxx
@ -124,7 +125,7 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl {
if (event.getTargetId().equals(source.getControllerId())) {
preventDamage(event, source, source.getControllerId(), game);
} else if (game.getOpponents(source.getControllerId()).contains(event.getTargetId())) {
event.setAmount(game.addWithOverflowCheck(event.getAmount(), event.getAmount()));
event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount()));
}
break;
case DAMAGE_CREATURE:
@ -134,7 +135,7 @@ class GiselaBladeOfGoldnightDoubleDamageEffect extends ReplacementEffectImpl {
if (permanent.getControllerId().equals(source.getControllerId())) {
preventDamage(event, source, permanent.getId(), game);
} else if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) {
event.setAmount(game.addWithOverflowCheck(event.getAmount(), event.getAmount()));
event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount()));
}
}
}