Crash if player spawn back to Y coord. >0 & <1

The issue come from  line 2664 : $v = $spawn->floor()  
If $spawn->y is in ]0..1[ then $v->y == 0
Then getBlockId : line 2670 use  'y' as -1 => Crash boom
This commit is contained in:
redcrab2016 2016-02-18 10:54:54 +01:00
parent fc42fc534b
commit 675583293f

View File

@ -2657,7 +2657,7 @@ class Level implements ChunkManager, Metadatable{
* @return bool|Position
*/
public function getSafeSpawn($spawn = null){
if(!($spawn instanceof Vector3) or $spawn->y <= 0){
if(!($spawn instanceof Vector3) or $spawn->y < 1){
$spawn = $this->getSpawnLocation();
}
if($spawn instanceof Vector3){