- Use local parent folder for loading in human deck in duel deck quest matches

This commit is contained in:
Sol
2014-11-27 03:30:35 +00:00
parent 361b0b69d9
commit a66019b9d9

View File

@@ -49,8 +49,13 @@ public class QuestChallengeReader extends StorageReaderFolder<QuestEventChalleng
String humanDeck = sectionQuest.get("HumanDeck", null);
if (humanDeck != null) {
File humanFile = new File(ForgeConstants.DEFAULT_CHALLENGES_DIR, humanDeck); // Won't work in other worlds!
qc.setHumanDeck(DeckSerializer.fromFile(humanFile));
// Defined human decks must live in the same directory as each other
try {
File humanFile = new File(file.getParent(), humanDeck);
qc.setHumanDeck(DeckSerializer.fromFile(humanFile));
} catch (Exception e) {
System.out.println("Defined human deck couldn't be loaded from " + file.getParent());
}
}
// Common properties