mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Level: Fixed entities getting deleted when switching levels
So this came from a bugfix (795d6c8ddf1148dfe6de8ff5ef38a96aee6124fe) which fixed a memory leak related to entities getting kill()ed on chunk unload. HOWEVER, me2016 did NOT realize that this code is actually entirely pointless and causes unexpected behaviour. removeEntity() is used in 2 places in the core code: 1. in Entity->close() (so close() doesn't need to be called again, obviously) 2. in Entity->switchLevel() (which then causes the entirely unexpected behaviour of close()ing the entity on level change. Conclusion: This code is pointless. This fixes the bugfix.
This commit is contained in:
parent
2e1a167bed
commit
d728154e87
@ -2607,8 +2607,6 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($entity instanceof Player){
|
||||
unset($this->players[$entity->getId()]);
|
||||
$this->checkSleep();
|
||||
}else{
|
||||
$entity->close();
|
||||
}
|
||||
|
||||
unset($this->entities[$entity->getId()]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user