mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-16 20:41:20 +01:00
Fix rewards prompt adding null override, fixes #1782
This commit is contained in:
parent
222313083e
commit
7818d7ae1e
@ -561,7 +561,7 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
if (plugin.hasLimitedAccess(context.getForWhom()) && !plugin.getSettings().canTrialSave()) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("modeDeny")
|
||||
.replace("mode", Lang.get("trialMode")));
|
||||
.replace("<mode>", Lang.get("trialMode")));
|
||||
return new ConditionMainPrompt(context);
|
||||
}
|
||||
plugin.getConditionFactory().saveCondition(context);
|
||||
|
@ -843,7 +843,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
if (plugin.hasLimitedAccess(context.getForWhom()) && !plugin.getSettings().canTrialSave()) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("modeDeny")
|
||||
.replace("mode", Lang.get("trialMode")));
|
||||
.replace("<mode>", Lang.get("trialMode")));
|
||||
return new QuestMainPrompt(context);
|
||||
}
|
||||
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) {
|
||||
|
@ -385,17 +385,18 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
@Override
|
||||
public @NotNull String getPromptText(final ConversationContext context) {
|
||||
final String input = (String) context.getSessionData(classPrefix + "-override");
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cancel"))
|
||||
&& !input.equalsIgnoreCase(Lang.get("clear"))) {
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cancel"))) {
|
||||
if (input.equalsIgnoreCase(Lang.get("clear"))) {
|
||||
context.setSessionData(CK.REW_DETAILS_OVERRIDE, null);
|
||||
} else {
|
||||
final LinkedList<String> overrides = new LinkedList<>();
|
||||
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) != null) {
|
||||
overrides.addAll((List<String>) context.getSessionData(CK.REW_DETAILS_OVERRIDE));
|
||||
} else {
|
||||
final LinkedList<String> overrides = new LinkedList<>();
|
||||
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) != null) {
|
||||
overrides.addAll((List<String>) context.getSessionData(CK.REW_DETAILS_OVERRIDE));
|
||||
}
|
||||
overrides.add(input);
|
||||
context.setSessionData(CK.REW_DETAILS_OVERRIDE, overrides);
|
||||
context.setSessionData(classPrefix + "-override", null);
|
||||
}
|
||||
overrides.add(input);
|
||||
context.setSessionData(CK.REW_DETAILS_OVERRIDE, overrides);
|
||||
context.setSessionData(classPrefix + "-override", null);
|
||||
}
|
||||
checkReward(context);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user