InventoryManager: ensure the windowID is valid before attempting to remove any window

this is currently a harmless bug, since remove() isn't currently doing any heavy lifting.
This commit is contained in:
Dylan K. Taylor 2022-09-28 01:01:42 +01:00
parent ed7c95549d
commit def2f8c145
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -259,7 +259,7 @@ class InventoryManager{
public function onClientRemoveWindow(int $id) : void{
if($id === $this->lastInventoryNetworkId){
if($id !== $this->pendingCloseWindowId){
if(isset($this->windowMap[$id]) && $id !== $this->pendingCloseWindowId){
$this->remove($id);
$this->player->removeCurrentWindow();
}