Don't add actions to the transaction if a crash occurred when getting the source inventory

This commit is contained in:
Dylan K. Taylor 2017-08-12 14:29:12 +01:00
parent 5d436a06ec
commit 83fcec3e94

View File

@ -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;
}
/**