mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 18:12:53 +08:00
call deregisterRegion appropriately
This commit is contained in:
parent
29bdb7f3f6
commit
44d8a6482e
@ -328,9 +328,11 @@ public class SceneScriptManager {
|
|||||||
if (trigger.event == EventType.EVENT_ENTER_REGION) {
|
if (trigger.event == EventType.EVENT_ENTER_REGION) {
|
||||||
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
|
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
|
||||||
getScene().getPlayers().forEach(p -> p.onEnterRegion(region.getMetaRegion()));
|
getScene().getPlayers().forEach(p -> p.onEnterRegion(region.getMetaRegion()));
|
||||||
|
deregisterRegion(region.getMetaRegion());
|
||||||
} else if (trigger.event == EventType.EVENT_LEAVE_REGION) {
|
} else if (trigger.event == EventType.EVENT_LEAVE_REGION) {
|
||||||
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
|
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
|
||||||
getScene().getPlayers().forEach(p -> p.onLeaveRegion(region.getMetaRegion()));
|
getScene().getPlayers().forEach(p -> p.onLeaveRegion(region.getMetaRegion()));
|
||||||
|
deregisterRegion(region.getMetaRegion());
|
||||||
}
|
}
|
||||||
deregisterTrigger(trigger);
|
deregisterTrigger(trigger);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user