From 95245d90ab2ac8d875440ef9e7ca65ddd3400940 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 6 Jul 2013 15:28:12 +0200 Subject: Core/Guilds: Some stuff that didnt get staged... Also fixed non-PCH build (I guess, not enough horsepower to check myself sadly) --- src/server/game/Guilds/Guild.cpp | 17 +++++++++++------ src/server/game/Spells/Spell.cpp | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index db524cb8804..a7caf654449 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1717,14 +1717,19 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) if (tabId != _GetPurchasedTabsSize()) return; - uint32 tabCost = _GetGuildBankTabPrice(tabId) * GOLD; - if (!tabCost) - 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 < GUILD_BANK_MAX_TABS - 2) // 7th tab is actually the 6th + { + uint32 tabCost = _GetGuildBankTabPrice(tabId) * GOLD; + if (!tabCost) + return; - if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client - return; + if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client + return; - player->ModifyMoney(-int64(tabCost)); + player->ModifyMoney(-int64(tabCost)); + } _CreateNewBankTab(); _BroadcastEvent(GE_BANK_TAB_PURCHASED, 0); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9a433f057e8..e74b74ffdd0 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -34,6 +34,7 @@ #include "Totem.h" #include "Spell.h" #include "DynamicObject.h" +#include "Guild.h" #include "Group.h" #include "UpdateData.h" #include "MapManager.h" -- cgit v1.2.3