Merge pull request #15720 from Tonghost/3.3.5
Core/Items: Fix a trading spoof exploit.
This commit is contained in:
commit
12ae32a9b6
4 files changed
+20
-4
No files matched your search
@@ -1435,3 +1435,19 @@ void Item::ItemContainerDeleteLootMoneyAndLootItemsFromDB()
|
||||
ItemContainerDeleteLootMoneyFromDB();
|
||||
ItemContainerDeleteLootItemsFromDB();
|
||||
}
|
||||
|
||||
void Item::SetCount(uint32 value)
|
||||
{
|
||||
SetUInt32Value(ITEM_FIELD_STACK_COUNT, value);
|
||||
|
||||
if (Player* player = GetOwner())
|
||||
{
|
||||
if (TradeData* tradeData = player->GetTradeData())
|
||||
{
|
||||
TradeSlots slot = tradeData->GetTradeSlotForItem(GetGUID());
|
||||
|
||||
if (slot != TRADE_SLOT_INVALID)
|
||||
tradeData->SetItem(slot, this, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ class Item : public Object
|
||||
bool GemsFitSockets() const;
|
||||
|
||||
uint32 GetCount() const { return GetUInt32Value(ITEM_FIELD_STACK_COUNT); }
|
||||
void SetCount(uint32 value) { SetUInt32Value(ITEM_FIELD_STACK_COUNT, value); }
|
||||
void SetCount(uint32 value);
|
||||
uint32 GetMaxStackCount() const { return GetTemplate()->GetMaxStackSize(); }
|
||||
uint8 GetGemCountWithID(uint32 GemID) const;
|
||||
uint8 GetGemCountWithLimitCategory(uint32 limitCategory) const;
|
||||
|
||||
@@ -324,13 +324,13 @@ Item* TradeData::GetSpellCastItem() const
|
||||
return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL;
|
||||
}
|
||||
|
||||
void TradeData::SetItem(TradeSlots slot, Item* item)
|
||||
void TradeData::SetItem(TradeSlots slot, Item* item, bool update /*= false*/)
|
||||
{
|
||||
ObjectGuid itemGuid;
|
||||
if (item)
|
||||
itemGuid = item->GetGUID();
|
||||
|
||||
if (m_items[slot] == itemGuid)
|
||||
if (m_items[slot] == itemGuid && !update)
|
||||
return;
|
||||
|
||||
m_items[slot] = itemGuid;
|
||||
|
||||
@@ -1020,7 +1020,7 @@ class TradeData
|
||||
Item* GetItem(TradeSlots slot) const;
|
||||
bool HasItem(ObjectGuid itemGuid) const;
|
||||
TradeSlots GetTradeSlotForItem(ObjectGuid itemGuid) const;
|
||||
void SetItem(TradeSlots slot, Item* item);
|
||||
void SetItem(TradeSlots slot, Item* item, bool update = false);
|
||||
|
||||
uint32 GetSpell() const { return m_spell; }
|
||||
void SetSpell(uint32 spell_id, Item* castItem = NULL);
|
||||
|
||||
Reference in new issue
Block a user