mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
try to fix crash in BoostPowerXSourceEffect
This commit is contained in:
parent
d217d332b6
commit
76537b0c66
1 changed files with 3 additions and 1 deletions
|
@ -42,6 +42,7 @@ import mage.game.permanent.Permanent;
|
|||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class BoostPowerXSourceEffect extends ContinuousEffectImpl<BoostPowerXSourceEffect> {
|
||||
private int amount = -1;
|
||||
|
||||
public BoostPowerXSourceEffect(Duration duration) {
|
||||
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
|
@ -58,7 +59,8 @@ public class BoostPowerXSourceEffect extends ContinuousEffectImpl<BoostPowerXSou
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = source.getCosts().getVariableCosts().get(0).getAmount();
|
||||
if (amount < 0)
|
||||
amount = source.getCosts().getVariableCosts().get(0).getAmount();
|
||||
Permanent target = (Permanent) game.getPermanent(source.getSourceId());
|
||||
if (target != null) {
|
||||
target.addPower(amount);
|
||||
|
|
Loading…
Reference in a new issue