From 83fcec3e941ee9afde05efbb53341163908c51a8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 12 Aug 2017 14:29:12 +0100 Subject: [PATCH] Don't add actions to the transaction if a crash occurred when getting the source inventory --- .../inventory/transaction/SimpleInventoryTransaction.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/inventory/transaction/SimpleInventoryTransaction.php b/src/pocketmine/inventory/transaction/SimpleInventoryTransaction.php index 6b4ebf5377..c4be1add02 100644 --- a/src/pocketmine/inventory/transaction/SimpleInventoryTransaction.php +++ b/src/pocketmine/inventory/transaction/SimpleInventoryTransaction.php @@ -86,11 +86,12 @@ class SimpleInventoryTransaction implements InventoryTransaction{ return; } - $this->actions[spl_object_hash($action)] = $action; if($action instanceof SlotChangeAction){ $action->setInventoryFrom($this->source); $this->inventories[spl_object_hash($action->getInventory())] = $action->getInventory(); } + + $this->actions[spl_object_hash($action)] = $action; } /**