Deregister scenes if no one is in them instead of deregistering when no entities are in them

This commit is contained in:
Melledy 2022-04-29 03:09:17 -07:00
parent c22c7ecb44
commit 331c02020c

View File

@ -225,7 +225,7 @@ public class Scene {
}
// Deregister scene if not in use
if (this.getEntities().size() <= 0 && !this.dontDestroyWhenEmpty()) {
if (this.getPlayerCount() <= 0 && !this.dontDestroyWhenEmpty()) {
this.getWorld().deregisterScene(this);
}
}