From 8d645b714fa80adec9b4bc05ada96aea20d59975 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 20 Mar 2018 10:55:24 +0000 Subject: [PATCH] Position: Destroy references to Level in isValid() --- src/pocketmine/level/Position.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/level/Position.php b/src/pocketmine/level/Position.php index b573818a8..770a69864 100644 --- a/src/pocketmine/level/Position.php +++ b/src/pocketmine/level/Position.php @@ -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; } /**