Replace player spaces & handle more data packets

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-05 17:13:12 +01:00
parent 9ebe68294b
commit 683c05f206
2 changed files with 15 additions and 3 deletions

View file

@ -76,7 +76,7 @@ class Entity extends stdClass{
}
public function update(){
if($this->class === ENTITY_ITEM){
if($this->class === ENTITY_ITEM and $this->closed === false){
$this->server->api->dhandle("entity.move", $this->eid);
$player = $this->server->query("SELECT EID FROM entities WHERE class == ".ENTITY_PLAYER." AND abs(x - {$this->x}) <= 1.5 AND abs(y - {$this->y}) <= 1.5 AND abs(z - {$this->z}) <= 1.5 LIMIT 1;", true);
if($player !== true and $player !== false){
@ -166,7 +166,7 @@ class Entity extends stdClass{
$this->server->query("DELETE FROM entities WHERE EID = ".$this->eid.";");
$this->server->api->dhandle("entity.remove", $this->eid);
$this->closed = true;
unset($this);
$this->__destruct();
}
}