Core/Items: Fix money refund amount. Also fix a possible exploit possibility of redeeming both vendor sellprice and money refund price in one go.

This commit is contained in:
Machiavelli
2011-01-24 23:10:08 +01:00
parent ba204ae3a7
commit 0ad2c90d22
2 changed files with 11 additions and 3 deletions
+5 -3
View File
@@ -24424,14 +24424,16 @@ void Player::RefundItem(Item *item)
data << uint32(iece->reqarenapoints); // arena point cost
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
{
data << iece->reqitem[i];
data << (iece->reqitemcount[i]);
data << uint32(iece->reqitem[i]);
data << uint32(iece->reqitemcount[i]);
}
GetSession()->SendPacket(&data);
// Delete any references to the refund data
item->SetNotRefundable(this);
uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem
// Destroy item
DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
@@ -24451,7 +24453,7 @@ void Player::RefundItem(Item *item)
}
// Grant back money
if (uint32 moneyRefund = item->GetPaidMoney())
if (moneyRefund)
ModifyMoney(moneyRefund);
// Grant back Honor points