aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Guilds/Guild.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-08-13 00:31:39 +0200
committerShauren <shauren.trinity@gmail.com>2025-08-13 00:31:39 +0200
commit5cf0c6c8bb2c4e58a2d66ba5f304af34d18a4782 (patch)
tree0616f3e83f511aae0e10916f0c22161017e09c24 /src/server/game/Guilds/Guild.cpp
parent82f19c898815e3bc5bb6288b0191ee897594f9b5 (diff)
Core: Updated to 11.2.0
Diffstat (limited to 'src/server/game/Guilds/Guild.cpp')
-rw-r--r--src/server/game/Guilds/Guild.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 4a270a005f9..28230a309b0 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -52,11 +52,13 @@ uint32 const EMBLEM_PRICE = 10 * GOLD;
inline uint64 GetGuildBankTabPrice(uint8 tabId)
{
- // these prices are in gold units, not copper
- static uint64 const tabPrices[GUILD_BANK_MAX_TABS] = { 100, 250, 500, 1000, 2500, 5000, 0, 0 };
- ASSERT(tabId < GUILD_BANK_MAX_TABS);
+ auto bankTab = std::ranges::find(sBankTabStore, std::pair(BankType::Guild, int8(tabId)),
+ [](BankTabEntry const* bankTab) { return std::pair(BankType(bankTab->BankType), bankTab->OrderIndex); });
- return tabPrices[tabId];
+ if (bankTab != sBankTabStore.end())
+ return bankTab->Cost;
+
+ return 0;
}
void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, GuildCommandError errCode, std::string_view param)
@@ -1659,7 +1661,7 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId)
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
// Remove money from bank
- uint64 tabCost = GetGuildBankTabPrice(tabId) * GOLD;
+ uint64 tabCost = GetGuildBankTabPrice(tabId);
if (tabCost && !_ModifyBankMoney(trans, tabCost, false)) // Should not happen, this is checked by client
return;