Fixed item spawning

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-05 15:01:21 +01:00
parent 344449fa12
commit c2a45212dd
2 changed files with 12 additions and 7 deletions

View file

@ -77,6 +77,7 @@ class Entity extends stdClass{
public function update(){
if($this->class === ENTITY_ITEM){
$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){
if($this->server->api->dhandle("player.item.pick", array(