Overflow check

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

View file

@ -126,7 +126,8 @@ class FarrelsMantleEffect extends OneShotEffect{
@Override
public boolean apply(Game game, Ability source) {
Permanent perm = game.getPermanent(source.getSourceId());
DamageTargetEffect dmgEffect = new DamageTargetEffect(2+perm.getPower().getValue());
int damage = game.addWithOverflowCheck(perm.getPower().getValue(), 2);
DamageTargetEffect dmgEffect = new DamageTargetEffect(damage);
return dmgEffect.apply(game, source);
}
}