mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
AuraReplacementEffect - Fixed possible null pointer exception.
This commit is contained in:
parent
12ee3f7e54
commit
5686f6b34f
1 changed files with 7 additions and 5 deletions
|
@ -91,7 +91,7 @@ public class AuraReplacementEffect extends ReplacementEffectImpl {
|
||||||
UUID sourceId = event.getSourceId();
|
UUID sourceId = event.getSourceId();
|
||||||
UUID controllerId = event.getPlayerId();
|
UUID controllerId = event.getPlayerId();
|
||||||
|
|
||||||
if(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null) {
|
if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null) {
|
||||||
card = card.getSecondCardFace();
|
card = card.getSecondCardFace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,10 +206,12 @@ public class AuraReplacementEffect extends ReplacementEffectImpl {
|
||||||
if (((ZoneChangeEvent) event).getToZone().equals(Zone.BATTLEFIELD)
|
if (((ZoneChangeEvent) event).getToZone().equals(Zone.BATTLEFIELD)
|
||||||
&& !(((ZoneChangeEvent) event).getFromZone().equals(Zone.STACK))) {
|
&& !(((ZoneChangeEvent) event).getFromZone().equals(Zone.STACK))) {
|
||||||
Card card = game.getCard(event.getTargetId());
|
Card card = game.getCard(event.getTargetId());
|
||||||
if (card != null && (card.getCardType().contains(CardType.ENCHANTMENT) && card.hasSubtype("Aura") ||
|
if (card != null && (card.getCardType().contains(CardType.ENCHANTMENT) && card.hasSubtype("Aura")
|
||||||
(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null &&
|
|| // in case of transformable enchantments
|
||||||
card.getSecondCardFace().getCardType().contains(CardType.ENCHANTMENT) &&
|
(game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null
|
||||||
card.getSecondCardFace().hasSubtype("Aura")))) {
|
&& card.getSecondCardFace() != null
|
||||||
|
&& card.getSecondCardFace().getCardType().contains(CardType.ENCHANTMENT)
|
||||||
|
&& card.getSecondCardFace().hasSubtype("Aura")))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue