mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
SLayoutIO Will catch more general exceptions - not just the ones related to malformed xml.
FControl.mayShowCard - will show card anyway wihout further checks if game has no human player
This commit is contained in:
@@ -329,7 +329,7 @@ public enum FControl {
|
|||||||
|
|
||||||
public boolean mayShowCard(Card c) {
|
public boolean mayShowCard(Card c) {
|
||||||
if ( game == null ) return true;
|
if ( game == null ) return true;
|
||||||
return c.canBeShownTo(getCurrentPlayer());
|
return !gameHasHumanPlayer || c.canBeShownTo(getCurrentPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public final class SLayoutIO {
|
|||||||
try {
|
try {
|
||||||
xer = inputFactory.createXMLEventReader(fis);
|
xer = inputFactory.createXMLEventReader(fis);
|
||||||
model = readLayout(xer);
|
model = readLayout(xer);
|
||||||
} catch (final XMLStreamException e) {
|
} catch (final Exception e) { // I don't care what happened inside, the layout is wrong
|
||||||
try {
|
try {
|
||||||
if ( xer != null ) xer.close();
|
if ( xer != null ) xer.close();
|
||||||
} catch (final XMLStreamException x) {
|
} catch (final XMLStreamException x) {
|
||||||
|
|||||||
Reference in New Issue
Block a user