mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core: use enum InventoryResult as return type for functions working with player items.
Original patch by TOM_RUS.
This commit is contained in:
@@ -249,7 +249,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
InventoryResult msg = InventoryResult(atoi(args));
|
||||
handler->GetSession()->GetPlayer()->SendEquipError(msg, NULL, NULL);
|
||||
return true;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
SellResult msg = SellResult(atoi(args));
|
||||
handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0, 0);
|
||||
return true;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint8 msg = atoi(args);
|
||||
BuyResult msg = BuyResult(atoi(args));
|
||||
handler->GetSession()->GetPlayer()->SendBuyError(msg, 0, 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1299,7 +1299,7 @@ public:
|
||||
uint32 ItemID = atoi(pItemID);
|
||||
uint32 SlotID = atoi(pSlotID);
|
||||
|
||||
ItemPrototype* tmpItem = sObjectMgr->GetItemTemplate(ItemID);
|
||||
ItemTemplate* tmpItem = sObjectMgr->GetItemTemplate(ItemID);
|
||||
|
||||
bool added = false;
|
||||
if (tmpItem)
|
||||
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 itemId = 24573;
|
||||
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, false);
|
||||
InventoryResult msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, false);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
pPlayer->StoreNewItem(dest, itemId, true);
|
||||
|
||||
@@ -105,12 +105,13 @@ public:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 itemId = 23614;
|
||||
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1);
|
||||
InventoryResult msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
if (Item* item = pPlayer->StoreNewItem(dest, itemId, true))
|
||||
pPlayer->SendNewItem(item, 1, false, true);
|
||||
} else
|
||||
}
|
||||
else
|
||||
pPlayer->SendEquipError(msg, NULL, NULL, itemId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user