diff --git a/Mage.Common/src/main/java/mage/remote/SessionImpl.java b/Mage.Common/src/main/java/mage/remote/SessionImpl.java index cd6979594e..19947d560f 100644 --- a/Mage.Common/src/main/java/mage/remote/SessionImpl.java +++ b/Mage.Common/src/main/java/mage/remote/SessionImpl.java @@ -920,10 +920,10 @@ public class SessionImpl implements Session { public boolean leaveChat(UUID chatId) { // lock.readLock().lock(); try { - if (isConnected()) { + if (isConnected() && chatId != null) { server.leaveChat(chatId, sessionId); - return true; } + return true; } catch (MageException ex) { handleMageException(ex); } catch (Throwable t) { diff --git a/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java b/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java index 60861faa60..56a5c395e3 100644 --- a/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java +++ b/Mage.Sets/src/mage/cards/k/KaronaFalseGod.java @@ -27,6 +27,7 @@ */ package mage.cards.k; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -49,8 +50,6 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author emerald000 @@ -60,7 +59,7 @@ public class KaronaFalseGod extends CardImpl { public KaronaFalseGod(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}{B}{R}{G}"); addSuperType(SuperType.LEGENDARY); - this.subtype.add("Avatar"); + this.subtype.add(SubType.AVATAR); this.power = new MageInt(5); this.toughness = new MageInt(5); diff --git a/Mage.Sets/src/mage/cards/m/MindsDesire.java b/Mage.Sets/src/mage/cards/m/MindsDesire.java index 12081133c1..1a239f6538 100644 --- a/Mage.Sets/src/mage/cards/m/MindsDesire.java +++ b/Mage.Sets/src/mage/cards/m/MindsDesire.java @@ -53,11 +53,11 @@ import mage.target.targetpointer.FixedTarget; public class MindsDesire extends CardImpl { public MindsDesire(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}{U}"); // Shuffle your library. Then exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. this.getSpellAbility().addEffect(new MindsDesireEffect()); - + // Storm this.addAbility(new StormAbility()); } @@ -73,21 +73,21 @@ public class MindsDesire extends CardImpl { } class MindsDesireEffect extends OneShotEffect { - + MindsDesireEffect() { super(Outcome.Benefit); - this.staticText = "Shuffle your library. Then exile the top card of your library. Until end of turn, you may play that card without paying its mana cost."; + this.staticText = "Shuffle your library. Then exile the top card of your library. Until end of turn, you may play that card without paying its mana cost"; } - + MindsDesireEffect(final MindsDesireEffect effect) { super(effect); } - + @Override public MindsDesireEffect copy() { return new MindsDesireEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -131,18 +131,21 @@ class MindsDesireCastFromExileEffect extends AsThoughEffectImpl { } @Override - public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - UUID targetId = getTargetPointer().getFirst(game, source); - Player player = game.getPlayer(affectedControllerId); - if (targetId != null && sourceId != null && targetId.equals(sourceId) && player != null) { + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (objectId != null && objectId.equals(getTargetPointer().getFirst(game, source))) { if (affectedControllerId.equals(source.getControllerId())) { - Card card = game.getCard(sourceId); - if (card != null && game.getState().getZone(sourceId) == Zone.EXILED) { - player.setCastSourceIdWithAlternateMana(sourceId, null, card.getSpellAbility().getCosts()); + Card card = game.getCard(objectId); + if (card != null && game.getState().getZone(objectId) == Zone.EXILED) { + if (!card.isLand() && card.getSpellAbility().getCosts() != null) { + Player player = game.getPlayer(affectedControllerId); + if (player != null) { + player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts()); + } + } return true; } } } return false; } -} \ No newline at end of file +}