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