Beware matching items that aren't actually correct

This would only ever happen if we received the actions in the wrong order, but that wouldn't surprise me.
This commit is contained in:
Dylan K. Taylor
2017-09-13 11:37:10 +01:00
parent 5267c571e9
commit c1c290cd39
3 changed files with 15 additions and 9 deletions

View File

@ -191,7 +191,7 @@ class NetworkInventoryAction{
$window = $player->getCraftingGrid();
//DROP_CONTENTS doesn't bother telling us what slot the item is in, so we find it ourselves
$inventorySlot = $window->first($this->oldItem);
$inventorySlot = $window->first($this->oldItem, true);
if($inventorySlot === -1){
throw new \InvalidStateException("Fake container " . get_class($window) . " for " . $player->getName() . " does not contain $this->oldItem");
}