Core/Items: Fix crash and updated documentation in SplitItem
This commit is contained in:
@@ -12891,7 +12891,9 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
|||||||
//! Update item count in trade window, prevent spoofing
|
//! Update item count in trade window, prevent spoofing
|
||||||
//! Since pSrcItem has its count updated (see above), Item::GetCount() will return the new count
|
//! Since pSrcItem has its count updated (see above), Item::GetCount() will return the new count
|
||||||
//! in the underlying packet builder function
|
//! in the underlying packet builder function
|
||||||
TradeSlots const slot = GetTradeData()->GetTradeSlotForItem(pSrcItem->GetGUID());
|
//! Note that this is not blizzlike, the item should be greyed out when in trade.
|
||||||
|
//! TODO: Figure out which packet(s) are responsible for that.
|
||||||
|
TradeSlots const slot = GetTradeData() ? GetTradeData()->GetTradeSlotForItem(pSrcItem->GetGUID()) : TRADE_SLOT_INVALID;
|
||||||
if (slot != TRADE_SLOT_INVALID)
|
if (slot != TRADE_SLOT_INVALID)
|
||||||
GetTradeData()->SetItem(slot, pSrcItem, true);
|
GetTradeData()->SetItem(slot, pSrcItem, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user