Skip to content

Commit

Permalink
Fix issues with regions (#2179)
Browse files Browse the repository at this point in the history
Luckily, SceneRegion and TriggerExcelConfigData both have group numbers, so we can use those to differentiate regions!
  • Loading branch information
scooterboo authored Jun 1, 2023
1 parent 9e5b57a commit 97c70f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/emu/grasscutter/game/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 97c70f7

Please sign in to comment.