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

@ -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();