Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Possible fix for #2267, #2314
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Nov 27, 2014
1 parent a7abd5f commit dd3207c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pocketmine/level/Level.php
Original file line number Diff line number Diff line change
Expand Up @@ -1936,18 +1936,18 @@ public function getSafeSpawn($spawn = null){
}
if($spawn instanceof Vector3){
$v = $spawn->floor();
for(; $v->y > 0; $v->y -= 2){
for(; $v->y > 0; --$v->y){
$b = $this->getBlock($v);
if($b === null){
return $spawn;
}elseif(!($b instanceof Air)){
$v->y += 1;
}elseif($b->isSolid){
$v->y++;
break;
}
}
for(; $v->y < 128; ++$v->y){
if($this->getBlock($v->getSide(1)) instanceof Air){
if($this->getBlock($v) instanceof Air){
if(!$this->getBlock($v->getSide(1))->isSolid){
if(!$this->getBlock($v)->isSolid){
return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this);
}
}else{
Expand Down

0 comments on commit dd3207c

Please sign in to comment.