Don´t inherit refund data when cloning when original item is not refundable.
--HG-- branch : trunk
This commit is contained in:
+34
-18
@@ -12012,17 +12012,22 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
|
||||
if (IsInventoryPos(dst))
|
||||
{
|
||||
bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
if (isRefundable)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
|
||||
|
||||
// change item amount before check (for unique max count check)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
|
||||
pSrcItem->SetCount(pSrcItem->GetCount() - count);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = CanStoreItem(dstbag, dstslot, dest, pNewItem, false);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
if (isRefundable)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count);
|
||||
|
||||
delete pNewItem;
|
||||
pSrcItem->SetCount(pSrcItem->GetCount() + count);
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count);
|
||||
SendEquipError(msg, pSrcItem, NULL);
|
||||
return;
|
||||
}
|
||||
@@ -12031,26 +12036,34 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
pSrcItem->SendUpdateToPlayer(this);
|
||||
pSrcItem->SetState(ITEM_CHANGED, this);
|
||||
StoreItem(dest, pNewItem, true);
|
||||
AddRefundReference(pNewItem->GetGUID(), count);
|
||||
pNewItem->SetPaidExtendedCost(pSrcItem->GetPaidExtendedCost());
|
||||
pNewItem->SetPaidMoney(pSrcItem->GetPaidMoney());
|
||||
pNewItem->SetRefundRecipient(GetGUIDLow());
|
||||
pNewItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, pSrcItem->GetPlayedTime());
|
||||
pNewItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
pNewItem->SaveRefundDataToDB(count);
|
||||
if (isRefundable)
|
||||
{
|
||||
AddRefundReference(pNewItem->GetGUID(), count);
|
||||
pNewItem->SetPaidExtendedCost(pSrcItem->GetPaidExtendedCost());
|
||||
pNewItem->SetPaidMoney(pSrcItem->GetPaidMoney());
|
||||
pNewItem->SetRefundRecipient(GetGUIDLow());
|
||||
pNewItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, pSrcItem->GetPlayedTime());
|
||||
pNewItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
pNewItem->SaveRefundDataToDB(count);
|
||||
}
|
||||
}
|
||||
else if (IsBankPos (dst))
|
||||
{
|
||||
bool isRefundable = pSrcItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
if (isRefundable)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
|
||||
|
||||
// change item amount before check (for unique max count check)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() - count);
|
||||
pSrcItem->SetCount(pSrcItem->GetCount() - count);
|
||||
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = CanBankItem(dstbag, dstslot, dest, pNewItem, false);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
if (isRefundable)
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count);
|
||||
|
||||
delete pNewItem;
|
||||
AlterRefundReferenceCount(pSrcItem->GetGUID(), pSrcItem->GetCount() + count);
|
||||
pSrcItem->SetCount(pSrcItem->GetCount() + count);
|
||||
SendEquipError(msg, pSrcItem, NULL);
|
||||
return;
|
||||
@@ -12060,13 +12073,16 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
pSrcItem->SendUpdateToPlayer(this);
|
||||
pSrcItem->SetState(ITEM_CHANGED, this);
|
||||
BankItem(dest, pNewItem, true);
|
||||
AddRefundReference(pNewItem->GetGUID(), count);
|
||||
pNewItem->SetPaidExtendedCost(pSrcItem->GetPaidExtendedCost());
|
||||
pNewItem->SetPaidMoney(pSrcItem->GetPaidMoney());
|
||||
pNewItem->SetRefundRecipient(GetGUIDLow());
|
||||
pNewItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, pSrcItem->GetPlayedTime());
|
||||
pNewItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
pNewItem->SaveRefundDataToDB(count);
|
||||
if (isRefundable)
|
||||
{
|
||||
AddRefundReference(pNewItem->GetGUID(), count);
|
||||
pNewItem->SetPaidExtendedCost(pSrcItem->GetPaidExtendedCost());
|
||||
pNewItem->SetPaidMoney(pSrcItem->GetPaidMoney());
|
||||
pNewItem->SetRefundRecipient(GetGUIDLow());
|
||||
pNewItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, pSrcItem->GetPlayedTime());
|
||||
pNewItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
|
||||
pNewItem->SaveRefundDataToDB(count);
|
||||
}
|
||||
}
|
||||
else if (IsEquipmentPos (dst))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user