From 969f0f05b02a11453c2ae7dbfc1aadcd8d65f26c Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Sat, 4 Jan 2014 11:59:07 +0900 Subject: [PATCH] Fix #1037 --- src/API/PlayerAPI.php | 2 +- src/Player.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index 525798e9..ed2e45d6 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -402,7 +402,7 @@ class PlayerAPI{ public function spawnToAllPlayers(Player $player){ foreach($this->getAll() as $p){ - if($p !== $player and ($p->entity instanceof Entity)){ + if($p !== $player and ($p->entity instanceof Entity) and ($player->entity instanceof Entity)){ $player->entity->spawn($p); if($p->level !== $player->level){ $p->dataPacket(MC_MOVE_ENTITY_POSROT, array( diff --git a/src/Player.php b/src/Player.php index 70efef7b..53976b7e 100644 --- a/src/Player.php +++ b/src/Player.php @@ -44,6 +44,7 @@ class Player{ private $startAction = false; private $isSleeping = false; public $data; + /** @var \Entity */ public $entity = false; public $auth = false; public $CID; @@ -78,6 +79,8 @@ class Player{ private $chunkCount = array(); private $received = array(); public $realmsData = array(); + /** @var \Level */ + public $level; public function __get($name){ if(isset($this->{$name})){