- Fix a rare NPE related to trying to show a card to a particular player outside of game context.

- Allow all cards to be shown the player when in developer mode (in order to be consistent with the fact that the player is able to see everything in dev mode including both players' hands and the content of both libraries).
This commit is contained in:
Agetian
2014-09-06 04:24:39 +00:00
parent fe63fd8925
commit c080f5cb19
2 changed files with 3 additions and 1 deletions

View File

@@ -8869,6 +8869,8 @@ public class Card extends GameEntity implements Comparable<Card> {
}
public boolean canBeShownTo(final Player viewer) {
if (viewer == null) { return false; }
Zone zone = this.getZone();
if (zone == null) { return true; } //cards outside any zone are visible to all

View File

@@ -370,7 +370,7 @@ public enum FControl implements KeyEventDispatcher {
}
public boolean mayShowCard(Card c) {
return game == null || !gameHasHumanPlayer || c.canBeShownTo(getCurrentPlayer());
return game == null || !gameHasHumanPlayer || ForgePreferences.DEV_MODE || c.canBeShownTo(getCurrentPlayer());
}
/**