mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +00:00
Position: Destroy references to Level in isValid()
This commit is contained in:
parent
403e996d2f
commit
8d645b714f
@ -94,7 +94,13 @@ class Position extends Vector3{
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isValid() : 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user