Return on Level->getSafeSpawn() in case of invalid position

This commit is contained in:
Shoghi Cervantes 2015-01-25 10:23:04 +01:00
parent ea44eee5df
commit 9886eb4768
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -2139,7 +2139,7 @@ class Level implements ChunkManager, Metadatable{
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);