Position: Destroy references to Level in isValid()

This commit is contained in:
Dylan K. Taylor 2018-03-20 10:55:24 +00:00
parent 403e996d2f
commit 8d645b714f

View File

@ -94,7 +94,13 @@ class Position extends Vector3{
* @return bool
*/
public function isValid() : bool{
return $this->getLevel() instanceof Level;
if($this->level !== null and $this->level->isClosed()){
$this->level = null;
return false;
}
return $this->level !== null;
}
/**