mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
InGamePacketHandler: fixed crash when attempting to drop more of an item than is available
This commit is contained in:
parent
eca9fe50b6
commit
58974765a6
@ -415,6 +415,9 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
$sourceSlotItem = $inventory->getItem($sourceSlot);
|
||||
if($sourceSlotItem->getCount() < $droppedCount){
|
||||
return false;
|
||||
}
|
||||
$serverItemStack = TypeConverter::getInstance()->coreItemStackToNet($sourceSlotItem);
|
||||
//because the client doesn't tell us the expected itemstack ID, we have to deep-compare our known
|
||||
//itemstack info with the one the client sent. This is costly, but we don't have any other option :(
|
||||
|
Loading…
x
Reference in New Issue
Block a user