From 767b2d21b7986583a52c222d3b932c2e31d268a4 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 24 Jan 2018 12:15:45 -0500 Subject: [PATCH] Core/Guild: Misc fixes --- Source/Game/Guilds/Guild.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Game/Guilds/Guild.cs b/Source/Game/Guilds/Guild.cs index 19fa89d5f..98302feca 100644 --- a/Source/Game/Guilds/Guild.cs +++ b/Source/Game/Guilds/Guild.cs @@ -510,14 +510,14 @@ namespace Game.Guilds if (tabId != _GetPurchasedTabsSize()) return; + if (tabId >= GuildConst.MaxBankTabs) + return; + // Do not get money for bank tabs that the GM bought, we had to buy them already. // This is just a speedup check, GetGuildBankTabPrice will return 0. if (tabId < GuildConst.MaxBankTabs - 2) // 7th tab is actually the 6th { - uint tabCost = _GetGuildBankTabPrice(tabId) * MoneyConstants.Gold; - if (tabCost == 0) - return; - + long tabCost = (long)(GetGuildBankTabPrice(tabId) * MoneyConstants.Gold); if (!player.HasEnoughMoney(tabCost)) // Should not happen, this is checked by client return; @@ -2368,8 +2368,9 @@ namespace Game.Guilds DB.Characters.Execute(stmt); } - uint _GetGuildBankTabPrice(byte tabId) + ulong GetGuildBankTabPrice(byte tabId) { + // these prices are in gold units, not copper switch (tabId) { case 0: return 100;