Skip to content

Commit 579f6f9

Browse files
committed
Fix possible dupe glitch
1 parent 4a13f83 commit 579f6f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/muqsit/invmenu/InvMenuEventHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace muqsit\invmenu;
66

7+
use muqsit\invmenu\inventory\InvMenuInventory;
78
use muqsit\invmenu\session\network\PlayerNetwork;
89
use muqsit\invmenu\session\PlayerManager;
910
use pocketmine\event\inventory\InventoryCloseEvent;
@@ -62,6 +63,12 @@ public function onInventoryTransaction(InventoryTransactionEvent $event) : void{
6263
$player_instance = $this->player_manager->get($player);
6364
$current = $player_instance->getCurrent();
6465
if($current === null){
66+
foreach($transaction->getActions() as $action){
67+
if($action instanceof SlotChangeAction && $action->getInventory() instanceof InvMenuInventory){
68+
$event->cancel();
69+
return;
70+
}
71+
}
6572
return;
6673
}
6774

0 commit comments

Comments
 (0)