mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fixed entity despawning
This commit is contained in:
parent
b9b0039cd7
commit
2801f18753
@ -118,6 +118,8 @@ class EntityAPI{
|
||||
|
||||
public function remove($eid){
|
||||
if(isset($this->server->entities[$eid])){
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$eid.";");
|
||||
$this->server->api->dhandle("entity.remove", $this->server->entities[$eid]);
|
||||
$this->server->entities[$eid]->close();
|
||||
unset($this->server->entities[$eid]);
|
||||
}
|
||||
|
@ -163,10 +163,8 @@ class Entity extends stdClass{
|
||||
|
||||
public function close(){
|
||||
if($this->closed === false){
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$this->eid.";");
|
||||
$this->server->api->dhandle("entity.remove", $this);
|
||||
$this->server->api->entity->remove($this->eid);
|
||||
$this->closed = true;
|
||||
$this->__destruct();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user