Skip to content

Commit

Permalink
Fix quest loading
Browse files Browse the repository at this point in the history
(Quests were Enumerable but had their ids uninitialized after deserializing from json, making them all have the same id)
  • Loading branch information
Hitonoriol committed Aug 15, 2022
1 parent d38b100 commit 12f6f62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.Show
allprojects {
apply plugin: "eclipse"

version = 'v0.49.18.1a'
version = 'v0.49.19a'

ext {
appName = "MadSand"
Expand Down
25 changes: 13 additions & 12 deletions core/src/hitonoriol/madsand/properties/QuestList.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package hitonoriol.madsand.properties;

import java.util.HashMap;

import hitonoriol.madsand.entities.quest.Quest;

public class QuestList {
public static final int NO_QUESTS_STATUS = -1;
public static final int QUEST_IN_PROGRESS_STATUS = -2;

public static HashMap<Integer, Quest> quests = new HashMap<Integer, Quest>();
}
package hitonoriol.madsand.properties;

import java.util.HashMap;
import java.util.Map;

import hitonoriol.madsand.entities.quest.Quest;

public class QuestList {
public static final int NO_QUESTS_STATUS = -1;
public static final int QUEST_IN_PROGRESS_STATUS = -2;

public static Map<Integer, Quest> quests = new HashMap<Integer, Quest>();
}
2 changes: 1 addition & 1 deletion core/src/hitonoriol/madsand/resources/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private static void loadTutorial() {
}

private static void loadQuests() {
QuestList.quests = loadMap(QUEST_FILE, Integer.class, Quest.class);
QuestList.quests = loadEnumerableMap(QUEST_FILE, Quest.class);
Utils.out(QuestList.quests.size() + " quests");
}

Expand Down

0 comments on commit 12f6f62

Please sign in to comment.