* Core/Misc: Improvement item durability repair logic

* Move item repair cost calculation logic from Player::DurabilityRepair to Item::CalculateDurabilityRepairCost
* Make item repair cost calculation more congruent with client logic (std::round)
* Do not repair items if player does not have enough money to pay for the repair of all items at once
* Withdrawing money from guild bank only once to avoid spam in the guild bank log and reduce number of transactions in the database
This commit is contained in:
Mikhail Redko authored and Ovahlord committed 2022-06-15 14:24:35 +02:00
1 parent b7d6959816
commit c0a1bc8c8d
7 files changed
+169 -83

No files matched your search

+9
View File
@@ -3073,6 +3073,15 @@ bool Guild::ChangeMemberRank(CharacterDatabaseTransaction& trans, ObjectGuid gui
return false;
}
uint64 Guild::GetMemberAvailableMoneyForRepairItems(ObjectGuid guid) const
{
Member const* member = GetMember(guid);
if (!member)
return 0;
return std::min(m_bankMoney, static_cast<uint64>(_GetMemberRemainingMoney(member)));
}
bool Guild::IsMember(ObjectGuid guid) const
{
Members::const_iterator itr = m_members.find(guid.GetCounter());