From e7a5800613e4ca80967a34348b3d9514b4f04f32 Mon Sep 17 00:00:00 2001 From: XenialDan Date: Sun, 28 Oct 2018 12:04:19 +0100 Subject: [PATCH] Fix isValid returning true if both positions are in different worlds Signed-off-by: thebigsmileXD --- plugin.yml | 2 +- src/xenialdan/MagicWE2/Selection.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin.yml b/plugin.yml index cf263953..ecc7b2b6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ --- name: MagicWE2 main: xenialdan\MagicWE2\Loader -version: 6.0.1 +version: 6.0.2 api: [4.0.0+dev, 3.2.5+dev] load: STARTUP authors: diff --git a/src/xenialdan/MagicWE2/Selection.php b/src/xenialdan/MagicWE2/Selection.php index be0219a2..959a4579 100644 --- a/src/xenialdan/MagicWE2/Selection.php +++ b/src/xenialdan/MagicWE2/Selection.php @@ -147,12 +147,10 @@ public function isValid(): bool $this->getLevel(); $this->getPos1(); $this->getPos2(); - if ($this->getPos1()->getLevel() === $this->getPos2()->getLevel()) - return true; + return ($this->getPos1()->getLevel() === $this->getLevel() && $this->getPos2()->getLevel() === $this->getLevel()); } catch (\Exception $e) { return false; } - return true; } /**