mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-30 14:43:39 +01:00
Check chat/command trigger size when loading, fixes #1268
This commit is contained in:
parent
19925f46e8
commit
1181ef099e
@ -2843,7 +2843,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
for (int i = 0; i < chatEvents.size(); i++) {
|
||||
Action action = loadAction(chatEvents.get(i));
|
||||
if (action != null) {
|
||||
if (i < chatEventTriggers.size()) {
|
||||
oStage.chatActions.put(chatEventTriggers.get(i), action);
|
||||
} else {
|
||||
throw new StageFormatException("chat-event-triggers list is too small",
|
||||
quest, stageNum);
|
||||
}
|
||||
} else {
|
||||
loadEventFailed = true;
|
||||
throw new StageFormatException("chat-events failed to load " + chatEvents.get(i),
|
||||
@ -2878,7 +2883,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
for (int i = 0; i < commandEvents.size(); i++) {
|
||||
Action action = loadAction(commandEvents.get(i));
|
||||
if (action != null) {
|
||||
if (i < commandEventTriggers.size()) {
|
||||
oStage.commandActions.put(commandEventTriggers.get(i), action);
|
||||
} else {
|
||||
throw new StageFormatException("command-event-triggers list is too small",
|
||||
quest, stageNum);
|
||||
}
|
||||
} else {
|
||||
loadEventFailed = true;
|
||||
throw new StageFormatException("command-events failed to load "
|
||||
|
Loading…
Reference in New Issue
Block a user