Overflow check

This commit is contained in:
Zzooouhh 2017-12-22 22:13:10 +01:00 committed by GitHub
parent 536f9732e4
commit bf8cd69f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,7 +129,7 @@ class DesperateGambitEffect extends PreventionEffectImpl {
if (controller != null && object != null) {
if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) {
if (wonFlip) {
event.setAmount(event.getAmount() * 2);
event.setAmount(game.addWithOverflowCheck(event.getAmount(), event.getAmount()));
this.discard();
} else {
preventDamageAction(event, source, game);