mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 15:22:16 +00:00
Update region logic (#2240)
This commit is contained in:
parent
4ec274f5c5
commit
83d447cfc2
@ -644,6 +644,7 @@ public class SceneScriptManager {
|
|||||||
.trace("Call EVENT_ENTER_REGION_{}", region.getMetaRegion().config_id);
|
.trace("Call EVENT_ENTER_REGION_{}", region.getMetaRegion().config_id);
|
||||||
this.callEvent(
|
this.callEvent(
|
||||||
new ScriptArgs(region.getGroupId(), EventType.EVENT_ENTER_REGION, region.getConfigId())
|
new ScriptArgs(region.getGroupId(), EventType.EVENT_ENTER_REGION, region.getConfigId())
|
||||||
|
.setEventSource(EntityType.Avatar.getValue())
|
||||||
.setSourceEntityId(region.getId())
|
.setSourceEntityId(region.getId())
|
||||||
.setTargetEntityId(targetId));
|
.setTargetEntityId(targetId));
|
||||||
|
|
||||||
@ -660,6 +661,7 @@ public class SceneScriptManager {
|
|||||||
if (region.entityHasLeft()) {
|
if (region.entityHasLeft()) {
|
||||||
this.callEvent(
|
this.callEvent(
|
||||||
new ScriptArgs(region.getGroupId(), EventType.EVENT_LEAVE_REGION, region.getConfigId())
|
new ScriptArgs(region.getGroupId(), EventType.EVENT_LEAVE_REGION, region.getConfigId())
|
||||||
|
.setEventSource(EntityType.Avatar.getValue())
|
||||||
.setSourceEntityId(region.getId())
|
.setSourceEntityId(region.getId())
|
||||||
.setTargetEntityId(region.getFirstEntityId()));
|
.setTargetEntityId(region.getFirstEntityId()));
|
||||||
|
|
||||||
@ -810,10 +812,8 @@ public class SceneScriptManager {
|
|||||||
.stream()
|
.stream()
|
||||||
.filter(
|
.filter(
|
||||||
t ->
|
t ->
|
||||||
!t.getCondition().isEmpty()
|
t.getName().substring(13).equals(String.valueOf(params.param1))
|
||||||
&& t.getCondition().substring(29).equals(String.valueOf(params.param1))
|
&& (t.getSource().isEmpty() || t.getSource().equals(params.getEventSource())))
|
||||||
&& (t.getSource().isEmpty()
|
|
||||||
|| t.getSource().equals(params.getEventSource())))
|
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
default -> this.getTriggersByEvent(eventType).stream()
|
default -> this.getTriggersByEvent(eventType).stream()
|
||||||
.filter(
|
.filter(
|
||||||
|
Loading…
Reference in New Issue
Block a user