aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWarpten <vertozor@gmail.com>2013-07-06 15:28:12 +0200
committerWarpten <vertozor@gmail.com>2013-07-06 15:28:12 +0200
commit95245d90ab2ac8d875440ef9e7ca65ddd3400940 (patch)
treeec2ecc54f95d70ed09072093a9301cb4f4787ded /src
parent37c048b8dbd6fe46d6a213a67c32c14571e05744 (diff)
Core/Guilds: Some stuff that didnt get staged...
Also fixed non-PCH build (I guess, not enough horsepower to check myself sadly)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Guilds/Guild.cpp17
-rw-r--r--src/server/game/Spells/Spell.cpp1
2 files changed, 12 insertions, 6 deletions
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"