Cleaned up Entity->close() handling

This commit is contained in:
Dylan K. Taylor
2019-04-18 17:23:48 +01:00
parent cc01dfe8df
commit 5913d5038b
4 changed files with 61 additions and 50 deletions

View File

@ -926,13 +926,13 @@ abstract class Living extends Entity implements Damageable{
$this->armorInventory->sendContents($player);
}
public function close() : void{
if(!$this->closed){
if($this->armorInventory !== null){
$this->armorInventory->removeAllViewers(true);
$this->armorInventory = null;
}
parent::close();
}
protected function onDispose() : void{
$this->armorInventory->removeAllViewers(true);
parent::onDispose();
}
protected function destroyCycles() : void{
$this->armorInventory = null;
parent::destroyCycles();
}
}