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