Fixed the transform message shown in the game log.

This commit is contained in:
LevelX2 2016-06-20 16:21:52 +02:00
parent ea53692b57
commit c15719b36b

View file

@ -32,7 +32,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken; import mage.game.permanent.PermanentCard;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
@ -87,12 +87,12 @@ public class TransformSourceEffect extends OneShotEffect {
if (!game.isSimulation()) { if (!game.isSimulation()) {
if (fromDayToNight) { if (fromDayToNight) {
if (permanent.getSecondCardFace() != null) { if (permanent.getSecondCardFace() != null) {
game.informPlayers(permanent.getIdName() + " transforms into " + permanent.getSecondCardFace().getIdName()); if (permanent instanceof PermanentCard) {
} else { game.informPlayers(((PermanentCard) permanent).getCard().getLogName() + " transforms into " + permanent.getSecondCardFace().getLogName());
logger.error("Can't get SecondCardFace " + permanent.getName() + " Token: " + (permanent instanceof PermanentToken ? "Yes" : "No")); }
} }
} else { } else {
game.informPlayers(permanent.getSecondCardFace().getIdName() + " transforms into " + permanent.getIdName()); game.informPlayers(permanent.getSecondCardFace().getLogName() + " transforms into " + permanent.getLogName());
} }
} }
} }