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

Commit

Permalink
Return on Level->getSafeSpawn() in case of invalid position
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Jan 25, 2015
1 parent ea44eee commit 9886eb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pocketmine/level/Level.php
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ public function getSafeSpawn($spawn = null){
break;
}
}
for(; $v->y < 128; ++$v->y){
for(; $v->y >= 0 and $v->y < 128; ++$v->y){
if(!Block::$solid[$chunk->getBlockId($x, $v->y + 1, $z)]){
if(!Block::$solid[$chunk->getBlockId($x, $v->y, $z)]){
return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this);
Expand Down

0 comments on commit 9886eb4

Please sign in to comment.