From e040c2b281a95269a69519ac88c7003277a427f0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 5 Jun 2022 16:02:26 +0100 Subject: [PATCH] InventoryManager: fixed windows not opening when the server removes windows closes #5094 --- src/network/mcpe/InventoryManager.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/mcpe/InventoryManager.php b/src/network/mcpe/InventoryManager.php index 0b17832f4..4b7f870f8 100644 --- a/src/network/mcpe/InventoryManager.php +++ b/src/network/mcpe/InventoryManager.php @@ -269,11 +269,13 @@ class InventoryManager{ //initiated the close and expect an ack. $this->session->sendDataPacket(ContainerClosePacket::create($id, false)); - if($this->pendingOpenWindowCallback !== null && $id === $this->pendingCloseWindowId){ - $this->session->getLogger()->debug("Opening deferred window after close ack of window $id"); + if($this->pendingCloseWindowId === $id){ $this->pendingCloseWindowId = null; - ($this->pendingOpenWindowCallback)(); - $this->pendingOpenWindowCallback = null; + if($this->pendingOpenWindowCallback !== null){ + $this->session->getLogger()->debug("Opening deferred window after close ack of window $id"); + ($this->pendingOpenWindowCallback)(); + $this->pendingOpenWindowCallback = null; + } } }