Skip to content

Commit

Permalink
Update region logic (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
scooterboo authored Jun 27, 2023
1 parent 4ec274f commit 83d447c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/emu/grasscutter/scripts/SceneScriptManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ public void checkRegions() {
.trace("Call EVENT_ENTER_REGION_{}", region.getMetaRegion().config_id);
this.callEvent(
new ScriptArgs(region.getGroupId(), EventType.EVENT_ENTER_REGION, region.getConfigId())
.setEventSource(EntityType.Avatar.getValue())
.setSourceEntityId(region.getId())
.setTargetEntityId(targetId));

Expand All @@ -660,6 +661,7 @@ public void checkRegions() {
if (region.entityHasLeft()) {
this.callEvent(
new ScriptArgs(region.getGroupId(), EventType.EVENT_LEAVE_REGION, region.getConfigId())
.setEventSource(EntityType.Avatar.getValue())
.setSourceEntityId(region.getId())
.setTargetEntityId(region.getFirstEntityId()));

Expand Down Expand Up @@ -810,10 +812,8 @@ private void realCallEvent(@Nonnull ScriptArgs params) {
.stream()
.filter(
t ->
!t.getCondition().isEmpty()
&& t.getCondition().substring(29).equals(String.valueOf(params.param1))
&& (t.getSource().isEmpty()
|| t.getSource().equals(params.getEventSource())))
t.getName().substring(13).equals(String.valueOf(params.param1))
&& (t.getSource().isEmpty() || t.getSource().equals(params.getEventSource())))
.collect(Collectors.toSet());
default -> this.getTriggersByEvent(eventType).stream()
.filter(
Expand Down

0 comments on commit 83d447c

Please sign in to comment.