From d70a35961b525e9a84858611fb39bc6eee8969a3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 1 Aug 2014 12:42:29 +0200 Subject: [PATCH] * Show playable cards - Fixed that this feature created NPEs because it was already called if no proper game step is set (small update). --- Mage/src/mage/players/PlayerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index a91b7b137ce..7b9a30d2696 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1982,7 +1982,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public Set getPlayableInHand(Game game) { Set playable = new HashSet<>(); - if (game.getStep() != null && !shouldSkipGettingPlayable(game)) { + if (!shouldSkipGettingPlayable(game)) { // for clean_up phase show all cards if (game.getPhase() != null && PhaseStep.CLEANUP.equals(game.getPhase().getStep().getType())) { for (Card card: hand.getCards(game)) { @@ -2025,6 +2025,9 @@ public abstract class PlayerImpl implements Player, Serializable { * @return */ private boolean shouldSkipGettingPlayable(Game game) { + if (game.getStep() == null) { // happens at the start of the game + return true; + } for (Entry phaseStep : silentPhaseSteps.entrySet()) { if (game.getPhase() != null && game.getPhase().getStep() != null && phaseStep.getKey().equals(game.getPhase().getStep().getType())) { if (phaseStep.getValue() == null || phaseStep.getValue().equals(game.getPhase().getStep().getStepPart())) {