From fb78df0caa8ea4b753ec615c78065802a720abe4 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Tue, 2 May 2023 22:44:13 -0400 Subject: [PATCH] Attempt to fix region issue --- .../java/emu/grasscutter/game/player/Player.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index e89252ebc..6e9eb4aaa 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -650,12 +650,13 @@ public class Player { } public void onEnterRegion(SceneRegion region) { - getQuestManager().forEachActiveQuest(quest -> { - if (quest.getTriggerData() != null && quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id)) { + this.getQuestManager().forEachActiveQuest(quest -> { + if (quest.getTriggerData() != null && + quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id)) { // If trigger hasn't been fired yet if (!Boolean.TRUE.equals(quest.getTriggers().put("ENTER_REGION_" + region.config_id, true))) { - //getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); - getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, + this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); + this.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, quest.getTriggerData().get("ENTER_REGION_" + region.config_id).getId(), 0); } } @@ -664,12 +665,12 @@ public class Player { } public void onLeaveRegion(SceneRegion region) { - getQuestManager().forEachActiveQuest(quest -> { + this.getQuestManager().forEachActiveQuest(quest -> { if (quest.getTriggers().containsKey("LEAVE_REGION_" + region.config_id)) { // If trigger hasn't been fired yet if (!Boolean.TRUE.equals(quest.getTriggers().put("LEAVE_REGION_" + region.config_id, true))) { - getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); - getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, + this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); + this.getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_TRIGGER_FIRE, quest.getTriggerData().get("LEAVE_REGION_" + region.config_id).getId(), 0); } }