Events can have more than one mob, fixes #38

This commit is contained in:
HappyPikachu 2017-07-16 00:48:55 -04:00
parent f95bff322e
commit ae154427af

View File

@ -1568,20 +1568,18 @@ public class EventFactory implements ConversationAbandonedListener {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobAmountsFirst"));
return new QuestMobPrompt(mobIndex, questMob);
}
if (context.getSessionData(CK.E_MOB_TYPES) == null) {
LinkedList<String> list = new LinkedList<String>();
list.add(questMob.serialize());
context.setSessionData(CK.E_MOB_TYPES, list);
} else {
if (((LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) {
if (context.getSessionData(CK.E_MOB_TYPES) == null || ((LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) {
LinkedList<String> list = new LinkedList<String>();
list.add(questMob.serialize());
context.setSessionData(CK.E_MOB_TYPES, list);
} else {
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.E_MOB_TYPES);
if (mobIndex < list.size()) {
list.set(mobIndex, questMob.serialize());
context.setSessionData(CK.E_MOB_TYPES, list);
} else {
list.add(questMob.serialize());
}
context.setSessionData(CK.E_MOB_TYPES, list);
}
return new MobPrompt();
} else if (input.equalsIgnoreCase("16")) {