Core: use enum InventoryResult as return type for functions working with player items.
Original patch by TOM_RUS.
This commit is contained in:
@@ -6315,7 +6315,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const * aurApp, uint8 mo
|
||||
uint32 count = m_amount;
|
||||
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellProto()->EffectItemType[m_effIndex], count, &noSpaceForCount);
|
||||
InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellProto()->EffectItemType[m_effIndex], count, &noSpaceForCount);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
count-=noSpaceForCount;
|
||||
|
||||
@@ -6092,7 +6092,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!m_IsTriggeredSpell && m_spellInfo->EffectItemType[i])
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(m_spellInfo->EffectItemType[i]);
|
||||
@@ -6127,7 +6127,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
return SPELL_FAILED_TOTEM_CATEGORY;
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->EffectItemType[i]);
|
||||
|
||||
@@ -2431,7 +2431,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
// can the player store the new item?
|
||||
ItemPosCountVec dest;
|
||||
uint32 no_space = 0;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, newitemid, num_to_add, &no_space);
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, newitemid, num_to_add, &no_space);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
// convert to possible store amount
|
||||
@@ -2897,7 +2897,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
|
||||
if (player->IsInventoryPos(pos))
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true);
|
||||
InventoryResult msg = player->CanStoreItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
|
||||
|
||||
Reference in New Issue
Block a user