Overflow check

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

View file

@ -91,7 +91,7 @@ class PhthisisEffect extends OneShotEffect {
if (creature != null) {
Player controller = game.getPlayer(creature.getControllerId());
if (controller != null) {
int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue();
int lifeLoss = game.addWithOverflowCheck(creature.getPower().getValue(), creature.getToughness().getValue());
creature.destroy(source.getSourceId(), game, false);
// the life loss happens also if the creature is indestructible or regenerated (legal targets)
controller.loseLife(lifeLoss, game, false);