From 97c70f7877c5998c87eff80662fcfbf7c5e60c9d Mon Sep 17 00:00:00 2001 From: Nazrin Date: Wed, 31 May 2023 23:04:18 -0700 Subject: [PATCH] Fix issues with regions (#2179) Luckily, SceneRegion and TriggerExcelConfigData both have group numbers, so we can use those to differentiate regions! --- src/main/java/emu/grasscutter/game/player/Player.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index df03e8d657d..bda5a2f1d8a 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -709,7 +709,8 @@ public TowerData getTowerData() { public void onEnterRegion(SceneRegion region) { this.getQuestManager().forEachActiveQuest(quest -> { if (quest.getTriggerData() != null && - quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id)) { + quest.getTriggers().containsKey("ENTER_REGION_"+ region.config_id) && + region.getGroupId() == quest.getTriggerData().get("ENTER_REGION_" + region.config_id).getGroupId()) { // If trigger hasn't been fired yet if (!Boolean.TRUE.equals(quest.getTriggers().put("ENTER_REGION_" + region.config_id, true))) { this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify()); @@ -723,7 +724,8 @@ public void onEnterRegion(SceneRegion region) { public void onLeaveRegion(SceneRegion region) { this.getQuestManager().forEachActiveQuest(quest -> { - if (quest.getTriggers().containsKey("LEAVE_REGION_" + region.config_id)) { + if (quest.getTriggers().containsKey("LEAVE_REGION_" + region.config_id) && + region.getGroupId() == quest.getTriggerData().get("ENTER_REGION_" + region.config_id).getGroupId()) { // If trigger hasn't been fired yet if (!Boolean.TRUE.equals(quest.getTriggers().put("LEAVE_REGION_" + region.config_id, true))) { this.getSession().send(new PacketServerCondMeetQuestListUpdateNotify());