Fixed invalid Position object on teleport

This commit is contained in:
Shoghi Cervantes 2014-01-23 19:02:09 +01:00
parent 4ae1709196
commit f432f110a4
2 changed files with 2 additions and 2 deletions

View File

@ -887,7 +887,7 @@ class Player{
return false;
}
if($pos instanceof Position and $pos->level !== $this->level){
if($pos instanceof Position and $pos->level instanceof Level and $pos->level !== $this->level){
if($this->server->api->dhandle("player.teleport.level", array("player" => $this, "origin" => $this->level, "target" => $pos->level)) === false){
$this->entity->check = true;
return false;

View File

@ -820,7 +820,7 @@ class Entity extends Position{
}
public function setPosition(Vector3 $pos, $yaw = false, $pitch = false){
if($pos instanceof Position and $this->level !== $pos->level){
if($pos instanceof Position and $pos->level instanceof Level and $this->level !== $pos->level){
$this->level = $pos->level;
$this->server->preparedSQL->entity->setLevel->reset();
$this->server->preparedSQL->entity->setLevel->clear();