Fixed server crash when two players sleep together

This commit is contained in:
Shoghi Cervantes 2013-09-04 17:13:03 +02:00
parent 28afadce0a
commit 7f15b27ff0

View File

@ -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;
} }
} }