diff --git a/src/main/java/emu/grasscutter/game/world/Scene.java b/src/main/java/emu/grasscutter/game/world/Scene.java index 9bca99fdf..94f36afc5 100644 --- a/src/main/java/emu/grasscutter/game/world/Scene.java +++ b/src/main/java/emu/grasscutter/game/world/Scene.java @@ -556,10 +556,6 @@ public final class Scene { this.finishLoading(); this.checkPlayerRespawn(); if (this.tickCount++ % 10 == 0) this.broadcastPacket(new PacketSceneTimeNotify(this)); - if (this.getPlayerCount() <= 0 && !this.dontDestroyWhenEmpty) { - this.getScriptManager().onDestroy(); - this.getWorld().deregisterScene(this); - } } /** Validates a player's current position. Teleports the player if the player is out of bounds. */ diff --git a/src/main/java/emu/grasscutter/game/world/World.java b/src/main/java/emu/grasscutter/game/world/World.java index 8c7595f33..d21aeeb33 100644 --- a/src/main/java/emu/grasscutter/game/world/World.java +++ b/src/main/java/emu/grasscutter/game/world/World.java @@ -437,7 +437,9 @@ public class World implements Iterable { // Check if there are players in this world. if (this.getPlayerCount() == 0) return true; // Tick all associated scenes. - this.getScenes().forEach((k, scene) -> scene.onTick()); + this.getScenes().forEach((k, scene) -> { + if (scene.getPlayerCount() > 0) scene.onTick(); + }); // sync time every 10 seconds if (this.tickCount % 10 == 0) {