Attempt to fix region issue

This commit is contained in:
KingRainbow44
2023-05-02 22:44:13 -04:00
parent d3c7377946
commit fb78df0caa

View File

@@ -650,12 +650,13 @@ public class Player {
} }
public void onEnterRegion(SceneRegion region) { public void onEnterRegion(SceneRegion region) {
getQuestManager().forEachActiveQuest(quest -> { this.getQuestManager().forEachActiveQuest(quest -> {
if (quest.getTriggerData() != null && quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id)) { if (quest.getTriggerData() != null &&
quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id)) {
// If trigger hasn't been fired yet // If trigger hasn't been fired yet
if (!Boolean.TRUE.equals(quest.getTriggers().put("ENTER_REGION_" + region.config_id, true))) { if (!Boolean.TRUE.equals(quest.getTriggers().put("ENTER_REGION_" + region.config_id, true))) {
//getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify());
getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, this.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE,
quest.getTriggerData().get("ENTER_REGION_" + region.config_id).getId(), 0); quest.getTriggerData().get("ENTER_REGION_" + region.config_id).getId(), 0);
} }
} }
@@ -664,12 +665,12 @@ public class Player {
} }
public void onLeaveRegion(SceneRegion region) { public void onLeaveRegion(SceneRegion region) {
getQuestManager().forEachActiveQuest(quest -> { this.getQuestManager().forEachActiveQuest(quest -> {
if (quest.getTriggers().containsKey("LEAVE_REGION_" + region.config_id)) { if (quest.getTriggers().containsKey("LEAVE_REGION_" + region.config_id)) {
// If trigger hasn't been fired yet // If trigger hasn't been fired yet
if (!Boolean.TRUE.equals(quest.getTriggers().put("LEAVE_REGION_" + region.config_id, true))) { if (!Boolean.TRUE.equals(quest.getTriggers().put("LEAVE_REGION_" + region.config_id, true))) {
getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify());
getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, this.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE,
quest.getTriggerData().get("LEAVE_REGION_" + region.config_id).getId(), 0); quest.getTriggerData().get("LEAVE_REGION_" + region.config_id).getId(), 0);
} }
} }