fixed various instances of getting source name (fixes #8531, fixes #8528)

This commit is contained in:
Evan Kranzler 2021-12-24 19:30:31 -05:00
parent 8791f30b4a
commit a6fcaab698
29 changed files with 54 additions and 94 deletions

View file

@ -1,7 +1,6 @@
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
@ -55,7 +54,6 @@ public class ExileFromZoneTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
MageObject mageObject = source.getSourceObject(game);
if (player == null) {
return false;
}
@ -75,7 +73,7 @@ public class ExileFromZoneTargetEffect extends OneShotEffect {
target.chooseTarget(Outcome.Exile, player.getId(), source, game);
Cards cards = new CardsImpl(target.getTargets());
if (withSource) {
return player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), mageObject.getName());
return player.moveCardsToExile(cards.getCards(game), source, game, true, CardUtil.getExileZoneId(game, source), CardUtil.getSourceName(game, source));
}
return player.moveCards(cards, Zone.EXILED, source, game);
}