From 72d40860f31e2dd14cd5363707dc3e5956d57dfd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 9 Aug 2017 19:05:00 +0100 Subject: [PATCH] Remove useless else branch and and return unhandled for unmatched window IDs --- src/pocketmine/Player.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 794bc3904..ec547d5ae 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2798,11 +2798,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ if(isset($this->windowIndex[$packet->windowId])){ $this->server->getPluginManager()->callEvent(new InventoryCloseEvent($this->windowIndex[$packet->windowId], $this)); $this->removeWindow($this->windowIndex[$packet->windowId]); - }else{ - unset($this->windowIndex[$packet->windowId]); + return true; } - return true; + return false; } public function handlePlayerHotbar(PlayerHotbarPacket $packet){