Overflow check

This commit is contained in:
Zzooouhh 2017-12-22 22:49:12 +01:00 committed by GitHub
parent 3fc7f0c513
commit 8e2b397f1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ class SentinelEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Permanent targetPermanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source));
if (controller != null && targetPermanent != null) {
int newToughness = targetPermanent.getPower().getValue() + 1;
int newToughness = game.addWithOverflowCheck(targetPermanent.getPower().getValue(), 1);
game.addEffect(new SetToughnessSourceEffect(new StaticValue(newToughness), Duration.Custom, SubLayer.SetPT_7b), source);
return true;
}