This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-20 18:39:24 +01:00
parent 58c258d422
commit 698515f31b
2 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class EntityAPI{
return false; return false;
} }
foreach($this->server->api->player->getAll() as $player){ foreach($this->server->api->player->getAll() as $player){
if($player->eid !== false){ if($player->eid !== false and $player->eid !== $eid){
$e->spawn($player); $e->spawn($player);
} }
} }

View File

@ -694,7 +694,6 @@ class Player{
$this->entity->z = $this->data->get("position")["z"]; $this->entity->z = $this->data->get("position")["z"];
$this->entity->setName($this->username); $this->entity->setName($this->username);
$this->entity->data["clientID"] = $this->clientID; $this->entity->data["clientID"] = $this->clientID;
$this->server->api->entity->spawnAll($this);
$this->evid[] = $this->server->event("server.time", array($this, "eventHandler")); $this->evid[] = $this->server->event("server.time", array($this, "eventHandler"));
$this->evid[] = $this->server->event("server.chat", array($this, "eventHandler")); $this->evid[] = $this->server->event("server.chat", array($this, "eventHandler"));
$this->evid[] = $this->server->event("entity.remove", array($this, "eventHandler")); $this->evid[] = $this->server->event("entity.remove", array($this, "eventHandler"));
@ -719,7 +718,8 @@ class Player{
if($this->spawned !== false){ if($this->spawned !== false){
break; break;
} }
$this->spawned = true; $this->spawned = true;
$this->server->api->entity->spawnAll($this);
$this->server->api->entity->spawnToAll($this->eid); $this->server->api->entity->spawnToAll($this->eid);
$this->server->schedule(5, array($this->entity, "update"), array(), true); $this->server->schedule(5, array($this->entity, "update"), array(), true);
$this->server->api->dhandle("player.armor", array("eid" => $this->eid, "slot0" => ($this->armor[0][0] > 0 ? ($this->armor[0][0] - 256):AIR), "slot1" => ($this->armor[1][0] > 0 ? ($this->armor[1][0] - 256):AIR), "slot2" => ($this->armor[2][0] > 0 ? ($this->armor[2][0] - 256):AIR), "slot3" => ($this->armor[3][0] > 0 ? ($this->armor[3][0] - 256):AIR))); $this->server->api->dhandle("player.armor", array("eid" => $this->eid, "slot0" => ($this->armor[0][0] > 0 ? ($this->armor[0][0] - 256):AIR), "slot1" => ($this->armor[1][0] > 0 ? ($this->armor[1][0] - 256):AIR), "slot2" => ($this->armor[2][0] > 0 ? ($this->armor[2][0] - 256):AIR), "slot3" => ($this->armor[3][0] > 0 ? ($this->armor[3][0] - 256):AIR)));