SignPost: fixed possible field read on null

This commit is contained in:
Dylan K. Taylor 2018-06-22 09:12:02 +01:00
parent 579ab5866b
commit ebacb8525f

View File

@ -61,7 +61,7 @@ class SignPost extends Transparent{
if($face !== Vector3::SIDE_DOWN){
if($face === Vector3::SIDE_UP){
$this->meta = floor((($player->yaw + 180) * 16 / 360) + 0.5) & 0x0f;
$this->meta = $player !== null ? (floor((($player->yaw + 180) * 16 / 360) + 0.5) & 0x0f) : 0;
$this->getLevel()->setBlock($blockReplace, $this, true);
}else{
$this->meta = $face;