1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-01-15 19:13:24 +00:00

CardUtil overflow

This commit is contained in:
Zzooouhh 2017-12-23 23:51:41 +01:00 committed by GitHub
parent c7db369eff
commit 34282dbd72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,7 @@ import mage.constants.CardType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.util.CardUtil;
/** /**
* *
@ -72,7 +73,7 @@ class TargetPermanentPowerPlusToughnessCount implements DynamicValue {
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
Permanent sourcePermanent = game.getPermanent(sourceAbility.getFirstTarget()); Permanent sourcePermanent = game.getPermanent(sourceAbility.getFirstTarget());
if (sourcePermanent != null) { if (sourcePermanent != null) {
return game.addWithOverflowCheck(sourcePermanent.getPower().getValue(), sourcePermanent.getToughness().getValue()); return CardUtil.addWithOverflowCheck(sourcePermanent.getPower().getValue(), sourcePermanent.getToughness().getValue());
} }
return 0; return 0;
} }