[8121] Cleanup and more safe code in Player::BuyItemFromVendor use. Author: VladimirMangos

* Move bag search by bag guid code to WorldSession::HandleBuyItemInSlotOpcode
    * Really reject unexisted bag cases.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-07 07:08:36 +08:00
parent d8da7f99d9
commit 3eab803495
4 changed files with 68 additions and 40 deletions
+1 -1
View File
@@ -1126,7 +1126,7 @@ class TRINITY_DLL_SPEC Player : public Unit
return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
}
void SendNewItem( Item *item, uint32 count, bool received, bool created, bool broadcast = false );
bool BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint64 bagguid, uint8 slot);
bool BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint8 bag, uint8 slot);
float GetReputationPriceDiscount( Creature const* pCreature ) const;
Player* GetTrader() const { return pTrader; }