- Fix Difficulty Index not being set after Save Game loads causing booster packs to be won too often.

This commit is contained in:
jendave
2011-08-06 08:05:51 +00:00
parent bc38d0f299
commit 9a4512a09b
2 changed files with 9 additions and 1 deletions

View File

@@ -199,6 +199,7 @@ public class Gui_QuestOptions extends JFrame {
void continueQuestButton_actionPerformed(ActionEvent e) { void continueQuestButton_actionPerformed(ActionEvent e) {
//set global variable //set global variable
AllZone.QuestData = QuestData.loadData(); AllZone.QuestData = QuestData.loadData();
AllZone.QuestData.setDifficultyIndex();
dispose(); dispose();
new Gui_Quest(); new Gui_Quest();
} }

View File

@@ -738,6 +738,13 @@ public class QuestData implements NewConstants {
difficulty = qdPrefs.getDifficulty(i); difficulty = qdPrefs.getDifficulty(i);
} }
public void setDifficultyIndex() {
String[] diffStr = qdPrefs.getDifficulty();
for(int i = 0; i < diffStr.length; i++)
if (difficulty.equals(diffStr[i]))
diffIndex = i;
}
public String[] getDifficutlyChoices() { public String[] getDifficutlyChoices() {
return qdPrefs.getDifficulty(); return qdPrefs.getDifficulty();
} }