mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
InventoryManager: fixed current window getting removed in race conditions with close window ACK
this could be observed by pressing E and immediately clicking a chest, which, if timed correctly, would lead to the chest lid closing, but the inventory being opened anyway.
This commit is contained in:
parent
78b5be8dd0
commit
fb25e05416
@ -259,8 +259,10 @@ class InventoryManager{
|
||||
|
||||
public function onClientRemoveWindow(int $id) : void{
|
||||
if($id === $this->lastInventoryNetworkId){
|
||||
$this->remove($id);
|
||||
$this->player->removeCurrentWindow();
|
||||
if($id !== $this->pendingCloseWindowId){
|
||||
$this->remove($id);
|
||||
$this->player->removeCurrentWindow();
|
||||
}
|
||||
}else{
|
||||
$this->session->getLogger()->debug("Attempted to close inventory with network ID $id, but current is $this->lastInventoryNetworkId");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user