mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Code style (game + scripts only):
"if(" --> "if ("
--HG--
branch : trunk
This commit is contained in:
@@ -36,7 +36,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
uint32 guildId;
|
||||
recvPacket >> guildId;
|
||||
|
||||
if(Guild *guild = objmgr.GetGuildById(guildId))
|
||||
if (Guild *guild = objmgr.GetGuildById(guildId))
|
||||
{
|
||||
guild->Query(this);
|
||||
return;
|
||||
@@ -52,11 +52,11 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
|
||||
std::string gname;
|
||||
recvPacket >> gname;
|
||||
|
||||
if(GetPlayer()->GetGuildId()) // already in guild
|
||||
if (GetPlayer()->GetGuildId()) // already in guild
|
||||
return;
|
||||
|
||||
Guild *guild = new Guild;
|
||||
if(!guild->Create(GetPlayer(), gname))
|
||||
if (!guild->Create(GetPlayer(), gname))
|
||||
{
|
||||
delete guild;
|
||||
return;
|
||||
@@ -74,24 +74,24 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
Player * player = NULL;
|
||||
recvPacket >> Invitedname;
|
||||
|
||||
if(normalizePlayerName(Invitedname))
|
||||
if (normalizePlayerName(Invitedname))
|
||||
player = ObjectAccessor::Instance().FindPlayerByName(Invitedname.c_str());
|
||||
|
||||
if(!player)
|
||||
if (!player)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, Invitedname, GUILD_PLAYER_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
// OK result but not send invite
|
||||
if(player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
|
||||
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
|
||||
return;
|
||||
|
||||
// not let enemies sign guild charter
|
||||
@@ -101,21 +101,21 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if(player->GetGuildId())
|
||||
if (player->GetGuildId())
|
||||
{
|
||||
plname = player->GetName();
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plname, ALREADY_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(player->GetGuildIdInvited())
|
||||
if (player->GetGuildIdInvited())
|
||||
{
|
||||
plname = player->GetName();
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plname, ALREADY_INVITED_TO_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_INVITE))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_INVITE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -142,17 +142,17 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
std::string plName;
|
||||
recvPacket >> plName;
|
||||
|
||||
if(!normalizePlayerName(plName))
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_REMOVE))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_REMOVE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -160,20 +160,20 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
if(!slot)
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
|
||||
if(slot->RankId == GR_GUILDMASTER)
|
||||
if (slot->RankId == GR_GUILDMASTER)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE);
|
||||
return;
|
||||
}
|
||||
|
||||
//do not allow to kick player with same or higher rights
|
||||
if(GetPlayer()->GetRank() >= slot->RankId)
|
||||
if (GetPlayer()->GetRank() >= slot->RankId)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_QUIT_S, plName, GUILD_RANK_TOO_HIGH_S);
|
||||
return;
|
||||
@@ -199,14 +199,14 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT");
|
||||
|
||||
guild = objmgr.GetGuildById(player->GetGuildIdInvited());
|
||||
if(!guild || player->GetGuildId())
|
||||
if (!guild || player->GetGuildId())
|
||||
return;
|
||||
|
||||
// not let enemies sign guild charter
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != objmgr.GetPlayerTeamByGUID(guild->GetLeader()))
|
||||
return;
|
||||
|
||||
if(!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
|
||||
if (!guild->AddMember(GetPlayer()->GetGUID(),guild->GetLowestRank()))
|
||||
return;
|
||||
// Put record into guildlog
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_JOIN_GUILD, GetPlayer()->GetGUIDLow(), 0, 0);
|
||||
@@ -234,7 +234,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_INFO");
|
||||
|
||||
guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
@@ -253,7 +253,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER");
|
||||
|
||||
if(Guild* guild = objmgr.GetGuildById(_player->GetGuildId()))
|
||||
if (Guild* guild = objmgr.GetGuildById(_player->GetGuildId()))
|
||||
guild->Roster(this);
|
||||
}
|
||||
|
||||
@@ -264,17 +264,17 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
std::string plName;
|
||||
recvPacket >> plName;
|
||||
|
||||
if(!normalizePlayerName(plName))
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_PROMOTE))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_PROMOTE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -283,13 +283,13 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
if(!slot)
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
return;
|
||||
}
|
||||
|
||||
if(plGuid == GetPlayer()->GetGUID())
|
||||
if (plGuid == GetPlayer()->GetGUID())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_NAME_INVALID);
|
||||
return;
|
||||
@@ -298,7 +298,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
//allow to promote only to lower rank than member's rank
|
||||
//guildmaster's rank = 0
|
||||
//GetPlayer()->GetRank() + 1 is highest rank that current player can promote to
|
||||
if(GetPlayer()->GetRank() + 1 >= slot->RankId)
|
||||
if (GetPlayer()->GetRank() + 1 >= slot->RankId)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_RANK_TOO_HIGH_S);
|
||||
return;
|
||||
@@ -326,18 +326,18 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
std::string plName;
|
||||
recvPacket >> plName;
|
||||
|
||||
if(!normalizePlayerName(plName))
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_DEMOTE))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_DEMOTE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -352,21 +352,21 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if(plGuid == GetPlayer()->GetGUID())
|
||||
if (plGuid == GetPlayer()->GetGUID())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_NAME_INVALID);
|
||||
return;
|
||||
}
|
||||
|
||||
//do not allow to demote same or higher rank
|
||||
if(GetPlayer()->GetRank() >= slot->RankId)
|
||||
if (GetPlayer()->GetRank() >= slot->RankId)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_RANK_TOO_HIGH_S);
|
||||
return;
|
||||
}
|
||||
|
||||
//do not allow to demote lowest rank
|
||||
if(slot->RankId >= guild->GetLowestRank())
|
||||
if (slot->RankId >= guild->GetLowestRank())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_ALREADY_LOWEST_RANK_S);
|
||||
return;
|
||||
@@ -392,19 +392,19 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(_player->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(_player->GetGUID() == guild->GetLeader() && guild->GetMemberSize() > 1)
|
||||
if (_player->GetGUID() == guild->GetLeader() && guild->GetMemberSize() > 1)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(_player->GetGUID() == guild->GetLeader())
|
||||
if (_player->GetGUID() == guild->GetLeader())
|
||||
{
|
||||
guild->Disband();
|
||||
return;
|
||||
@@ -430,13 +430,13 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
if (GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -456,7 +456,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
|
||||
Player *oldLeader = GetPlayer();
|
||||
|
||||
if(!normalizePlayerName(name))
|
||||
if (!normalizePlayerName(name))
|
||||
return;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(oldLeader->GetGuildId());
|
||||
@@ -467,7 +467,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if( oldLeader->GetGUID() != guild->GetLeader())
|
||||
if ( oldLeader->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -501,19 +501,19 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
|
||||
|
||||
std::string MOTD;
|
||||
|
||||
if(!recvPacket.empty())
|
||||
if (!recvPacket.empty())
|
||||
recvPacket >> MOTD;
|
||||
else
|
||||
MOTD = "";
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_SETMOTD))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_SETMOTD))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -537,7 +537,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
std::string name,PNOTE;
|
||||
recvPacket >> name;
|
||||
|
||||
if(!normalizePlayerName(name))
|
||||
if (!normalizePlayerName(name))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
@@ -575,7 +575,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
std::string plName, OFFNOTE;
|
||||
recvPacket >> plName;
|
||||
|
||||
if(!normalizePlayerName(plName))
|
||||
if (!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
@@ -615,13 +615,13 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_RANK");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
else if(GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
else if (GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos()); // set to end to avoid warnings spam
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
@@ -665,19 +665,19 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> rankname;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
if (GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
if(guild->GetRanksSize() >= GUILD_RANKS_MAX_COUNT) // client not let create more 10 than ranks
|
||||
if (guild->GetRanksSize() >= GUILD_RANKS_MAX_COUNT) // client not let create more 10 than ranks
|
||||
return;
|
||||
|
||||
guild->CreateRank(rankname, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
|
||||
@@ -691,12 +691,12 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
|
||||
sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK");
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
else if(GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
else if (GetPlayer()->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -728,13 +728,13 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> GINFO;
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_MODIFY_GUILD_INFO))
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_MODIFY_GUILD_INFO))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
@@ -764,11 +764,11 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
if (!guild)
|
||||
{
|
||||
//"You are not part of a guild!";
|
||||
SendSaveGuildEmblem(ERR_GUILDEMBLEM_NOGUILD);
|
||||
@@ -782,7 +782,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetPlayer()->GetMoney() < 10*GOLD)
|
||||
if (GetPlayer()->GetMoney() < 10*GOLD)
|
||||
{
|
||||
//"You can't afford to do that."
|
||||
SendSaveGuildEmblem(ERR_GUILDEMBLEM_NOTENOUGHMONEY);
|
||||
@@ -802,8 +802,8 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
|
||||
{
|
||||
// empty
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
|
||||
if(uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
pGuild->DisplayGuildEventLog(this);
|
||||
}
|
||||
|
||||
@@ -812,8 +812,8 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
|
||||
void WorldSession::HandleGuildBankMoneyWithdrawn( WorldPacket & /* recv_data */ )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
|
||||
if(uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
pGuild->SendMoneyInfo(this, GetPlayer()->GetGUIDLow());
|
||||
}
|
||||
|
||||
@@ -821,9 +821,9 @@ void WorldSession::HandleGuildPermissions( WorldPacket& /* recv_data */ )
|
||||
{
|
||||
sLog.outDebug("WORLD: Received (MSG_GUILD_PERMISSIONS)");
|
||||
|
||||
if(uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
{
|
||||
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
{
|
||||
uint32 rankId = GetPlayer()->GetRank();
|
||||
|
||||
@@ -859,7 +859,7 @@ void WorldSession::HandleGuildBankerActivate( WorldPacket & recv_data )
|
||||
|
||||
if (uint32 GuildId = GetPlayer()->GetGuildId())
|
||||
{
|
||||
if(Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
if (Guild *pGuild = objmgr.GetGuildById(GuildId))
|
||||
{
|
||||
pGuild->DisplayGuildBankTabsInfo(this); // this also will load guild bank if not yet
|
||||
return;
|
||||
@@ -935,7 +935,7 @@ void WorldSession::HandleGuildBankDepositMoney( WorldPacket & recv_data )
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
// logging money
|
||||
if(_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
_player->GetName(),_player->GetSession()->GetAccountId(),money,GuildId);
|
||||
@@ -968,7 +968,7 @@ void WorldSession::HandleGuildBankWithdrawMoney( WorldPacket & recv_data )
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
if(!pGuild)
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
if (!pGuild->GetPurchasedTabs())
|
||||
@@ -1098,7 +1098,7 @@ void WorldSession::HandleGuildBankSwapItems( WorldPacket & recv_data )
|
||||
// Player <-> Bank
|
||||
|
||||
// allow work with inventory only
|
||||
if(!Player::IsInventoryPos(PlayerBag, PlayerSlot) && !(PlayerBag == NULL_BAG && PlayerSlot == NULL_SLOT) )
|
||||
if (!Player::IsInventoryPos(PlayerBag, PlayerSlot) && !(PlayerBag == NULL_BAG && PlayerSlot == NULL_SLOT) )
|
||||
{
|
||||
_player->SendEquipError( EQUIP_ERR_NONE, NULL, NULL );
|
||||
return;
|
||||
@@ -1129,7 +1129,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
|
||||
return;
|
||||
|
||||
Guild *pGuild = objmgr.GetGuildById(GuildId);
|
||||
if(!pGuild)
|
||||
if (!pGuild)
|
||||
return;
|
||||
|
||||
// m_PurchasedTabs = 0 when buying Tab 0, that is why this check can be made
|
||||
@@ -1166,10 +1166,10 @@ void WorldSession::HandleGuildBankUpdateTab( WorldPacket & recv_data )
|
||||
recv_data >> Name;
|
||||
recv_data >> IconIndex;
|
||||
|
||||
if(Name.empty())
|
||||
if (Name.empty())
|
||||
return;
|
||||
|
||||
if(IconIndex.empty())
|
||||
if (IconIndex.empty())
|
||||
return;
|
||||
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
|
||||
Reference in New Issue
Block a user