mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
refactor(Core): replace NULL with nullptr (#4593)
This commit is contained in:
@@ -36,13 +36,13 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(srcbag, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -127,13 +127,13 @@ void WorldSession::HandleSwapItem(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(srcbag, srcslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recvData)
|
||||
_player->AutoUnequipOffhandIfNeed();
|
||||
|
||||
// Xinef: Call this here after all needed items are equipped
|
||||
_player->RemoveItemDependentAurasAndCasts((Item*)NULL);
|
||||
_player->RemoveItemDependentAurasAndCasts((Item*)nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,13 +273,13 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData)
|
||||
Item* pItem = _player->GetItemByPos(bag, slot);
|
||||
if (!pItem)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_USER_DESTROY)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
|
||||
SendPacket(&data);
|
||||
}
|
||||
else
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
|
||||
@@ -643,7 +643,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -768,7 +768,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid, uint32 vendorEntry)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid)));
|
||||
#endif
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1011,7 +1011,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1200,7 +1200,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (!_player->IsAlive())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (!_player->GetItemCount(item))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, nullptr);
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user