mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 05:55:33 +00:00
Fixed #2207 Server crashing if players are closed before logging in
This commit is contained in:
parent
516bb37a50
commit
be948f99cc
@ -228,8 +228,10 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if(!$this->closed){
|
if(!$this->closed){
|
||||||
foreach($this->getInventory()->getViewers() as $player){
|
if(!($this instanceof Player) or $this->loggedIn){
|
||||||
$this->getInventory()->close($player);
|
foreach($this->getInventory()->getViewers() as $player){
|
||||||
|
$this->getInventory()->close($player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->inventory = null;
|
$this->inventory = null;
|
||||||
parent::close();
|
parent::close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user