mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fixes for old quests not working with tournaments.
This commit is contained in:
@@ -20,6 +20,7 @@ package forge.quest;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
@@ -151,6 +152,12 @@ public class QuestController {
|
||||
}
|
||||
|
||||
public IStorage<DeckGroup> getDraftDecks() {
|
||||
if (draftDecks == null) {
|
||||
draftDecks = new QuestDeckGroupMap(new HashMap<String, DeckGroup>());
|
||||
}
|
||||
if (this.getAchievements().getCurrentDraftIndex() == -1 || this.getAchievements().getCurrentDraft() == null) {
|
||||
draftDecks.delete(QuestEventDraft.DECK_NAME);
|
||||
}
|
||||
return draftDecks;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,12 @@ public class QuestAchievements {
|
||||
}
|
||||
|
||||
public QuestEventDraft getCurrentDraft() {
|
||||
if (drafts.size() == 0) {
|
||||
if (drafts == null || drafts.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
if (currentDraft > drafts.size() - 1) {
|
||||
currentDraft = -1;
|
||||
FModel.getQuest().getDraftDecks().delete(QuestEventDraft.DECK_NAME);
|
||||
return null;
|
||||
}
|
||||
return drafts.get(currentDraft);
|
||||
|
||||
@@ -306,7 +306,7 @@ public class QuestDataIO {
|
||||
}
|
||||
|
||||
// pet manager will be re-engineered here
|
||||
|
||||
case 5:
|
||||
case 6:
|
||||
// have to convert completed challenges list members to strings.
|
||||
for(int i = qA.getLockedChallenges().size()-1; i >= 0; i-- ) {
|
||||
@@ -320,8 +320,11 @@ public class QuestDataIO {
|
||||
qA.getCurrentChallenges().set(i, lc.toString());
|
||||
}
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
System.out.println("UPDATE");
|
||||
QuestDataIO.setFinalField(QuestAssets.class, "draftDecks", qS, new HashMap<String, DeckGroup>());
|
||||
qS.getDraftDeckStorage();
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user