From da4334f06be4742184923057866cadbec27f696a Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 1 Nov 2014 23:02:59 +0100 Subject: [PATCH] Revert Armor then Inventory instead of Inventory then Armor on failed transaction --- src/pocketmine/Player.php | 4 ++-- src/pocketmine/inventory/SimpleTransactionGroup.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 477127459..ff7736e94 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2129,10 +2129,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 0.4)){ if($this->currentTransaction instanceof SimpleTransactionGroup){ foreach($this->currentTransaction->getInventories() as $inventory){ - $inventory->sendContents($inventory->getViewers()); if($inventory instanceof PlayerInventory){ - $inventory->sendArmorContents($inventory->getViewers()); + $inventory->sendArmorContents($this); } + $inventory->sendContents($this); } } $this->currentTransaction = new SimpleTransactionGroup($this); diff --git a/src/pocketmine/inventory/SimpleTransactionGroup.php b/src/pocketmine/inventory/SimpleTransactionGroup.php index 9f37310a1..71edb330e 100644 --- a/src/pocketmine/inventory/SimpleTransactionGroup.php +++ b/src/pocketmine/inventory/SimpleTransactionGroup.php @@ -141,10 +141,10 @@ class SimpleTransactionGroup implements TransactionGroup{ Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this)); if($ev->isCancelled()){ foreach($this->inventories as $inventory){ - $inventory->sendContents($inventory->getViewers()); if($inventory instanceof PlayerInventory){ - $inventory->sendArmorContents($inventory->getViewers()); + $inventory->sendArmorContents($this->getSource()); } + $inventory->sendContents($this->getSource()); } return false;