From cd22b3013b9c9dc1c9698285d7ea935676f57314 Mon Sep 17 00:00:00 2001 From: fwannmacher Date: Mon, 25 Jul 2016 16:34:36 -0300 Subject: [PATCH] - Fixed Issue #2102 --- Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java b/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java index 1aca51b42a..30845efe6d 100644 --- a/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java +++ b/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java @@ -48,6 +48,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.players.Player; /** @@ -152,9 +153,10 @@ class NayaSoulbeastReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Object object = this.getValue("NayaSoulbeastCounters"); - if (object instanceof Integer) { + Permanent permanent = game.getPermanentEntering(source.getSourceId()); + if (permanent!= null && object instanceof Integer) { int amount = ((Integer) object); - new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source); + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } return false; }