Core/Guilds: Some stuff that didnt get staged...

Also fixed non-PCH build (I guess, not enough horsepower to check myself sadly)
This commit is contained in:
Warpten
2013-07-06 15:28:12 +02:00
parent 37c048b8db
commit 95245d90ab
2 changed files with 12 additions and 6 deletions

View File

@@ -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);

View File

@@ -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"