mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
InGamePacketHandler: fix weak comparisons
This commit is contained in:
parent
a1ba8bc3da
commit
d1fa6edc50
@ -416,7 +416,7 @@ class InGamePacketHandler extends PacketHandler{
|
||||
$droppedCount = null;
|
||||
|
||||
foreach($data->getActions() as $networkInventoryAction){
|
||||
if($networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_WORLD && $networkInventoryAction->inventorySlot == NetworkInventoryAction::ACTION_MAGIC_SLOT_DROP_ITEM){
|
||||
if($networkInventoryAction->sourceType === NetworkInventoryAction::SOURCE_WORLD && $networkInventoryAction->inventorySlot === NetworkInventoryAction::ACTION_MAGIC_SLOT_DROP_ITEM){
|
||||
$droppedCount = $networkInventoryAction->newItem->getItemStack()->getCount();
|
||||
if($droppedCount <= 0){
|
||||
throw new PacketHandlingException("Expected positive count for dropped item");
|
||||
@ -578,7 +578,7 @@ class InGamePacketHandler extends PacketHandler{
|
||||
private function handleReleaseItemTransaction(ReleaseItemTransactionData $data) : bool{
|
||||
$this->player->selectHotbarSlot($data->getHotbarSlot());
|
||||
|
||||
if($data->getActionType() == ReleaseItemTransactionData::ACTION_RELEASE){
|
||||
if($data->getActionType() === ReleaseItemTransactionData::ACTION_RELEASE){
|
||||
$this->player->releaseHeldItem();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user