mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-12 03:13:51 +01:00
Keep original quest ID after editing, fixes #1070
This commit is contained in:
parent
f5ac927641
commit
feb6fd1527
@ -1396,6 +1396,10 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
if (questSection == null) {
|
||||
questSection = data.createSection("quests");
|
||||
}
|
||||
System.out.println("id= " + context.getSessionData(CK.Q_ID));
|
||||
ConfigurationSection newSection;
|
||||
if (context.getSessionData(CK.Q_ID) == null) {
|
||||
// Creating
|
||||
int customNum = 1;
|
||||
while (true) {
|
||||
if (questSection.contains("custom" + customNum)) {
|
||||
@ -1404,7 +1408,11 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ConfigurationSection newSection = questSection.createSection("custom" + customNum);
|
||||
newSection = questSection.createSection("custom" + customNum);
|
||||
} else {
|
||||
// Editing
|
||||
newSection = questSection.createSection((String)context.getSessionData(CK.Q_ID));
|
||||
}
|
||||
saveQuest(context, newSection);
|
||||
data.save(new File(plugin.getDataFolder(), "quests.yml"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.GREEN
|
||||
|
Loading…
Reference in New Issue
Block a user