Overflow check

This commit is contained in:
Zzooouhh 2017-12-22 22:54:25 +01:00 committed by GitHub
parent c0fb7b5cf0
commit 95bde33ddb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,8 +131,8 @@ class DracoplasmEffect extends ReplacementEffectImpl {
for (UUID targetId : target.getTargets()) {
Permanent targetCreature = game.getPermanent(targetId);
if (targetCreature != null && targetCreature.sacrifice(source.getSourceId(), game)) {
power += targetCreature.getPower().getValue();
toughness += targetCreature.getToughness().getValue();
power = game.addWithOverflowCheck(power, targetCreature.getPower().getValue());
toughness = game.addWithOverflowCheck(toughness, targetCreature.getToughness().getValue());
}
}
ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b);
@ -141,4 +141,4 @@ class DracoplasmEffect extends ReplacementEffectImpl {
}
return false;
}
}
}