call deregisterRegion appropriately

This commit is contained in:
akatatsu27 2022-07-24 13:33:48 +03:00
parent 29bdb7f3f6
commit 44d8a6482e

View File

@ -328,9 +328,11 @@ public class SceneScriptManager {
if (trigger.event == EventType.EVENT_ENTER_REGION) {
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
getScene().getPlayers().forEach(p -> p.onEnterRegion(region.getMetaRegion()));
deregisterRegion(region.getMetaRegion());
} else if (trigger.event == EventType.EVENT_LEAVE_REGION) {
EntityRegion region = this.regions.values().stream().filter(p -> p.getConfigId() == params.param1).toList().get(0);
getScene().getPlayers().forEach(p -> p.onLeaveRegion(region.getMetaRegion()));
deregisterRegion(region.getMetaRegion());
}
deregisterTrigger(trigger);
} else {