mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Bottled Cloister - Fixed a Null Pointer Exception bug.
This commit is contained in:
parent
859e945799
commit
c794dab8d1
1 changed files with 10 additions and 6 deletions
|
@ -40,6 +40,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -134,15 +135,18 @@ class BottledCloisterReturnEffect extends OneShotEffect {
|
|||
if (controller != null && sourcePermanent != null) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
int numberOfCards = 0;
|
||||
for (Card card: game.getExile().getExileZone(exileId).getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId())) {
|
||||
numberOfCards++;
|
||||
card.setFaceDown(false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone != null) {
|
||||
for (Card card: exileZone.getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId())) {
|
||||
numberOfCards++;
|
||||
card.setFaceDown(false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (numberOfCards > 0) {
|
||||
game.informPlayers(sourcePermanent.getName() + ": " + controller.getName() + " returns "+ numberOfCards + " card" + (numberOfCards > 1 ?"s":"") + " from exile to hand");
|
||||
game.informPlayers(sourcePermanent.getLogName() + ": " + controller.getName() + " returns "+ numberOfCards + " card" + (numberOfCards > 1 ?"s":"") + " from exile to hand");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue