Stair: fixed crash if player is null

This commit is contained in:
Dylan K. Taylor 2019-01-26 16:59:03 +00:00
parent 48c8c2a8c3
commit 9826abd83e

View File

@ -89,7 +89,7 @@ abstract class Stair extends Transparent{
2 => 1, 2 => 1,
3 => 3 3 => 3
]; ];
$this->meta = $faces[$player->getDirection()] & 0x03; $this->meta = $player !== null ? $faces[$player->getDirection()] & 0x03 : 0;
if(($clickVector->y > 0.5 and $face !== Vector3::SIDE_UP) or $face === Vector3::SIDE_DOWN){ if(($clickVector->y > 0.5 and $face !== Vector3::SIDE_UP) or $face === Vector3::SIDE_DOWN){
$this->meta |= 0x04; //Upside-down stairs $this->meta |= 0x04; //Upside-down stairs
} }