mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
Fixed server crash when two players sleep together
This commit is contained in:
@@ -295,7 +295,7 @@ class Player{
|
|||||||
public function sleepOn(Vector3 $pos){
|
public function sleepOn(Vector3 $pos){
|
||||||
foreach($this->server->api->player->getAll($this->level) as $p){
|
foreach($this->server->api->player->getAll($this->level) as $p){
|
||||||
if($p->isSleeping instanceof Vector3){
|
if($p->isSleeping instanceof Vector3){
|
||||||
if($p->distance($pos) <= 0.1){
|
if($pos->distance($p->isSleeping) <= 0.1){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user