Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-05-10 08:46:47 -06:00
committed by GitHub
54 changed files with 1435 additions and 1325 deletions

View File

@@ -807,6 +807,14 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
{
if (pProto->SellPrice > 0)
{
uint32 money = pProto->SellPrice * count;
if (_player->GetMoney() >= MAX_MONEY_AMOUNT - money) // prevent exceeding gold limit
{
_player->SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, nullptr, nullptr);
_player->SendSellError(SELL_ERR_UNK, creature, itemguid, 0);
return;
}
if (sWorld->getBoolConfig(CONFIG_ITEMDELETE_VENDOR))
recoveryItem(pItem);
@@ -839,7 +847,6 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData)
_player->UpdateTitansGrip();
}
uint32 money = pProto->SellPrice * count;
_player->ModifyMoney(money);
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
}