Fixed other invisibility issues

This commit is contained in:
Shoghi Cervantes
2015-06-04 16:51:48 +02:00
parent 05dbf7b47f
commit 71490f60f2
8 changed files with 32 additions and 22 deletions

View File

@ -189,8 +189,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
}
public function spawnTo(Player $player){
if($player !== $this and !isset($this->hasSpawned[$player->getId()])){
$this->hasSpawned[$player->getId()] = $player;
if($player !== $this and !isset($this->hasSpawned[$player->getLoaderId()])){
$this->hasSpawned[$player->getLoaderId()] = $player;
if(strlen($this->skin) < 64 * 32 * 4){
throw new \InvalidStateException((new \ReflectionClass($this))->getShortName() . " must have a valid skin set");
@ -221,12 +221,12 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
}
public function despawnFrom(Player $player){
if(isset($this->hasSpawned[$player->getId()])){
if(isset($this->hasSpawned[$player->getLoaderId()])){
$pk = new RemovePlayerPacket();
$pk->eid = $this->getId();
$pk->clientID = $this->getId();
$player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
unset($this->hasSpawned[$player->getId()]);
unset($this->hasSpawned[$player->getLoaderId()]);
}
}