Skip to content

Commit fa44a16

Browse files
committed
Bug fix: inventory close listener called on unsuccessful send()s
1 parent ab3ab2d commit fa44a16

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/muqsit/invmenu/session/PlayerWindowDispatcher.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public function run() : void{
126126

127127
public function setResult(bool $result) : void{
128128
$this->result = $result;
129+
if(!$result){
130+
// this belongs here so we do not end up calling inventory close listener on failed dispatches
131+
$this->session->current = null;
132+
}
129133
$this->task_handler?->cancel();
130134
$this->task_handler = null;
131135
if($this->session->player->isConnected()){

0 commit comments

Comments
 (0)