mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 15:49:54 +00:00
Fixed invalid Position object on teleport
This commit is contained in:
parent
4ae1709196
commit
f432f110a4
@ -887,7 +887,7 @@ class Player{
|
|||||||
return false;
|
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){
|
if($this->server->api->dhandle("player.teleport.level", array("player" => $this, "origin" => $this->level, "target" => $pos->level)) === false){
|
||||||
$this->entity->check = true;
|
$this->entity->check = true;
|
||||||
return false;
|
return false;
|
||||||
|
@ -820,7 +820,7 @@ class Entity extends Position{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setPosition(Vector3 $pos, $yaw = false, $pitch = false){
|
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->level = $pos->level;
|
||||||
$this->server->preparedSQL->entity->setLevel->reset();
|
$this->server->preparedSQL->entity->setLevel->reset();
|
||||||
$this->server->preparedSQL->entity->setLevel->clear();
|
$this->server->preparedSQL->entity->setLevel->clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user