aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2012-01-18 13:10:36 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2012-01-18 13:14:06 +0100
commitabd94e324b1ba872da331e19a3e80a6667edb363 (patch)
tree3c1bb4cc949c92b97b884f050bcfeb299c3f74c3 /src
parent1f42324c4430cc42a7929a2c5748410d7647d380 (diff)
Core/Items: Fix crash and updated documentation in SplitItem
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 855fb9332b2..eb270521500 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -12891,7 +12891,9 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
//! Update item count in trade window, prevent spoofing
//! Since pSrcItem has its count updated (see above), Item::GetCount() will return the new count
//! 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)
GetTradeData()->SetItem(slot, pSrcItem, true);
}