REPO: code-style clean-up
* Fixed pGuild->guild * Fixed pGroup->group * Fixed pOwner->owner
This commit is contained in:
@@ -348,13 +348,13 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
if (!IS_PLAYER_GUID(GetOwnerGUID()))
|
||||
return;
|
||||
|
||||
Player* pOwner = (Player*)GetOwner();
|
||||
if (!pOwner)
|
||||
Player* owner = (Player*)GetOwner();
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
// not save pet as current if another pet temporary unsummoned
|
||||
if (mode == PET_SAVE_AS_CURRENT && pOwner->GetTemporaryUnsummonedPetNumber() &&
|
||||
pOwner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
|
||||
if (mode == PET_SAVE_AS_CURRENT && owner->GetTemporaryUnsummonedPetNumber() &&
|
||||
owner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
|
||||
{
|
||||
// pet will lost anyway at restore temporary unsummoned
|
||||
if (getPetType() == HUNTER_PET)
|
||||
|
||||
@@ -4774,8 +4774,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
sObjectAccessor->ConvertCorpseForPlayer(playerguid);
|
||||
|
||||
if (uint32 guildId = GetGuildIdFromDB(playerguid))
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId))
|
||||
pGuild->DeleteMember(guid);
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(guildId))
|
||||
guild->DeleteMember(guid);
|
||||
|
||||
// remove from arena teams
|
||||
LeaveAllArenaTeams(playerguid);
|
||||
@@ -5462,11 +5462,11 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
Guild* pGuild = sGuildMgr->GetGuildById(GetGuildId());
|
||||
if (!pGuild)
|
||||
Guild* guild = sGuildMgr->GetGuildById(GetGuildId());
|
||||
if (!guild)
|
||||
return TotalCost;
|
||||
|
||||
if (!pGuild->HandleMemberWithdrawMoney(GetSession(), costs, true))
|
||||
if (!guild->HandleMemberWithdrawMoney(GetSession(), costs, true))
|
||||
return TotalCost;
|
||||
|
||||
TotalCost = costs;
|
||||
@@ -15668,9 +15668,9 @@ void Player::AreaExploredOrEventHappens(uint32 questId)
|
||||
//not used in Trinityd, function for external script library
|
||||
void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject)
|
||||
{
|
||||
if (Group* pGroup = GetGroup())
|
||||
if (Group* group = GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupGuy = itr->getSource();
|
||||
|
||||
@@ -22374,9 +22374,9 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
||||
uint64 creature_guid = (pRewardSource->GetTypeId() == TYPEID_UNIT) ? pRewardSource->GetGUID() : uint64(0);
|
||||
|
||||
// prepare data for near group iteration
|
||||
if (Group* pGroup = GetGroup())
|
||||
if (Group* group = GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupGuy = itr->getSource();
|
||||
if (!pGroupGuy)
|
||||
@@ -22390,7 +22390,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
||||
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
|
||||
}
|
||||
}
|
||||
else // if (!pGroup)
|
||||
else // if (!group)
|
||||
KilledMonsterCredit(creature_id, creature_guid);
|
||||
}
|
||||
|
||||
@@ -22609,14 +22609,14 @@ void Player::SendCorpseReclaimDelay(bool load)
|
||||
|
||||
Player* Player::GetNextRandomRaidMember(float radius)
|
||||
{
|
||||
Group* pGroup = GetGroup();
|
||||
if (!pGroup)
|
||||
Group* group = GetGroup();
|
||||
if (!group)
|
||||
return NULL;
|
||||
|
||||
std::vector<Player*> nearMembers;
|
||||
nearMembers.reserve(pGroup->GetMembersCount());
|
||||
nearMembers.reserve(group->GetMembersCount());
|
||||
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
|
||||
@@ -10081,9 +10081,9 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
|
||||
|
||||
if (!player)
|
||||
return NULL;
|
||||
Group* pGroup = player->GetGroup();
|
||||
Group* group = player->GetGroup();
|
||||
// When there is no group check pet presence
|
||||
if (!pGroup)
|
||||
if (!group)
|
||||
{
|
||||
// We are pet now, return owner
|
||||
if (player != this)
|
||||
@@ -10098,9 +10098,9 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
|
||||
|
||||
std::vector<Unit*> nearMembers;
|
||||
// reserve place for players and pets because resizing vector every unit push is unefficient (vector is reallocated then)
|
||||
nearMembers.reserve(pGroup->GetMembersCount() * 2);
|
||||
nearMembers.reserve(group->GetMembersCount() * 2);
|
||||
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* Target = itr->getSource())
|
||||
{
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
@@ -15682,8 +15682,8 @@ void Unit::SetStunned(bool apply)
|
||||
SetTarget(getVictim()->GetGUID());
|
||||
|
||||
// don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface)
|
||||
Unit* pOwner = GetOwner();
|
||||
if (!pOwner || (pOwner->GetTypeId() == TYPEID_PLAYER && !pOwner->ToPlayer()->IsMounted()))
|
||||
Unit* owner = GetOwner();
|
||||
if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted()))
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
if (!HasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect
|
||||
@@ -16183,10 +16183,10 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
Group* pGroup = owner->GetGroup();
|
||||
if (pGroup)
|
||||
Group* group = owner->GetGroup();
|
||||
if (group)
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
@@ -16214,15 +16214,15 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
|
||||
void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
|
||||
{
|
||||
Unit* owner = GetCharmerOrOwnerOrSelf();
|
||||
Group* pGroup = NULL;
|
||||
Group* group = NULL;
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
pGroup = owner->ToPlayer()->GetGroup();
|
||||
group = owner->ToPlayer()->GetGroup();
|
||||
|
||||
if (pGroup)
|
||||
if (group)
|
||||
{
|
||||
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
|
||||
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
@@ -16251,15 +16251,15 @@ void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
|
||||
void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
|
||||
{
|
||||
Unit* owner = GetCharmerOrOwnerOrSelf();
|
||||
Group* pGroup = NULL;
|
||||
Group* group = NULL;
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
pGroup = owner->ToPlayer()->GetGroup();
|
||||
group = owner->ToPlayer()->GetGroup();
|
||||
|
||||
if (pGroup)
|
||||
if (group)
|
||||
{
|
||||
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
|
||||
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Guild::BankTab::SendText(const Guild* pGuild, WorldSession* session) const
|
||||
void Guild::BankTab::SendText(const Guild* guild, WorldSession* session) const
|
||||
{
|
||||
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1 + m_text.size() + 1);
|
||||
data << uint8(m_tabId);
|
||||
@@ -498,7 +498,7 @@ void Guild::BankTab::SendText(const Guild* pGuild, WorldSession* session) const
|
||||
if (session)
|
||||
session->SendPacket(&data);
|
||||
else
|
||||
pGuild->BroadcastPacket(&data);
|
||||
guild->BroadcastPacket(&data);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -671,7 +671,7 @@ void Guild::Member::DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabI
|
||||
// If (tabId == GUILD_BANK_MAX_TABS) return money amount.
|
||||
// Otherwise return remaining items amount for specified tab.
|
||||
// If reset time was more than 24 hours ago, renew reset time and reset amount to maximum value.
|
||||
uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) const
|
||||
uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* guild) const
|
||||
{
|
||||
// Guild master has unlimited amount.
|
||||
if (IsRank(GR_GUILDMASTER))
|
||||
@@ -679,7 +679,7 @@ uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) co
|
||||
|
||||
// Check rights for non-money tab.
|
||||
if (tabId != GUILD_BANK_MAX_TABS)
|
||||
if ((pGuild->_GetRankBankTabRights(m_rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||
if ((guild->_GetRankBankTabRights(m_rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||
return 0;
|
||||
|
||||
uint32 curTime = uint32(::time(NULL) / MINUTE); // minutes
|
||||
@@ -688,8 +688,8 @@ uint32 Guild::Member::GetBankRemainingValue(uint8 tabId, const Guild* pGuild) co
|
||||
RemainingValue& rv = const_cast <RemainingValue&> (m_bankRemaining[tabId]);
|
||||
rv.resetTime = curTime;
|
||||
rv.value = tabId == GUILD_BANK_MAX_TABS ?
|
||||
pGuild->_GetRankBankMoneyPerDay(m_rankId) :
|
||||
pGuild->_GetRankBankTabSlotsPerDay(m_rankId, tabId);
|
||||
guild->_GetRankBankMoneyPerDay(m_rankId) :
|
||||
guild->_GetRankBankTabSlotsPerDay(m_rankId, tabId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(
|
||||
tabId == GUILD_BANK_MAX_TABS ?
|
||||
@@ -1293,7 +1293,7 @@ void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo)
|
||||
{
|
||||
Player* player = session->GetPlayer();
|
||||
if (!_IsLeader(player))
|
||||
// "Only pGuild leaders can create emblems."
|
||||
// "Only guild leaders can create emblems."
|
||||
SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTGUILDMASTER);
|
||||
else if (!player->HasEnoughMoney(EMBLEM_PRICE))
|
||||
// "You can't afford to do that."
|
||||
@@ -1634,7 +1634,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
|
||||
if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||
{
|
||||
sLog->outCommand(player->GetSession()->GetAccountId(),
|
||||
"GM %s (Account: %u) deposit money (Amount: %u) to pGuild bank (Guild ID %u)",
|
||||
"GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)",
|
||||
player->GetName(), player->GetSession()->GetAccountId(), amount, m_id);
|
||||
}
|
||||
// Log guild bank event
|
||||
|
||||
@@ -473,7 +473,7 @@ private:
|
||||
|
||||
void SetInfo(const std::string& name, const std::string& icon);
|
||||
void SetText(const std::string& text);
|
||||
void SendText(const Guild* pGuild, WorldSession* session) const;
|
||||
void SendText(const Guild* guild, WorldSession* session) const;
|
||||
|
||||
inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; }
|
||||
bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem);
|
||||
@@ -492,7 +492,7 @@ private:
|
||||
class MoveItemData
|
||||
{
|
||||
public:
|
||||
MoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) : m_pGuild(pGuild), m_pPlayer(player),
|
||||
MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
|
||||
m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
|
||||
virtual ~MoveItemData() { }
|
||||
|
||||
@@ -538,8 +538,8 @@ private:
|
||||
class PlayerMoveItemData : public MoveItemData
|
||||
{
|
||||
public:
|
||||
PlayerMoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) :
|
||||
MoveItemData(pGuild, player, container, slotId) { }
|
||||
PlayerMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
|
||||
MoveItemData(guild, player, container, slotId) { }
|
||||
|
||||
bool IsBank() const { return false; }
|
||||
bool InitItem();
|
||||
@@ -553,8 +553,8 @@ private:
|
||||
class BankMoveItemData : public MoveItemData
|
||||
{
|
||||
public:
|
||||
BankMoveItemData(Guild* pGuild, Player* player, uint8 container, uint8 slotId) :
|
||||
MoveItemData(pGuild, player, container, slotId) { }
|
||||
BankMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
|
||||
MoveItemData(guild, player, container, slotId) { }
|
||||
|
||||
bool IsBank() const { return true; }
|
||||
bool InitItem();
|
||||
|
||||
@@ -430,19 +430,19 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
|
||||
tab->Process(*this, store.IsRatesAllowed(), lootMode); // Processing is done there, callback via Loot::AddItem()
|
||||
|
||||
// Setting access rights for group loot case
|
||||
Group* pGroup = lootOwner->GetGroup();
|
||||
if (!personal && pGroup)
|
||||
Group* group = lootOwner->GetGroup();
|
||||
if (!personal && group)
|
||||
{
|
||||
roundRobinPlayer = lootOwner->GetGUID();
|
||||
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* pl = itr->getSource()) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
|
||||
FillNotNormalLootFor(pl, pl->IsAtGroupRewardDistance(lootOwner));
|
||||
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(items[i].itemid))
|
||||
if (proto->Quality < uint32(pGroup->GetLootThreshold()))
|
||||
if (proto->Quality < uint32(group->GetLootThreshold()))
|
||||
items[i].is_underthreshold = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2240,8 +2240,8 @@ bool InstanceMap::CanEnter(Player* player)
|
||||
}
|
||||
|
||||
// cannot enter while an encounter is in progress on raids
|
||||
/*Group* pGroup = player->GetGroup();
|
||||
if (!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
/*Group* group = player->GetGroup();
|
||||
if (!player->isGameMaster() && group && group->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
|
||||
@@ -432,9 +432,9 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
|
||||
|
||||
void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
|
||||
{
|
||||
if (Group* pGroup = killer->GetGroup())
|
||||
if (Group* group = killer->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupGuy = itr->getSource();
|
||||
|
||||
|
||||
@@ -883,8 +883,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
|
||||
if (pCurrChar->GetGuildId() != 0)
|
||||
{
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId()))
|
||||
pGuild->SendLoginInfo(this);
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId()))
|
||||
guild->SendLoginInfo(this);
|
||||
else
|
||||
{
|
||||
// remove wrong guild data
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false)
|
||||
{
|
||||
if (uint32 guildId = session->GetPlayer()->GetGuildId()) // If guild id = 0, player is not in guild
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId)) // Find guild by id
|
||||
return pGuild;
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(guildId)) // Find guild by id
|
||||
return guild;
|
||||
if (sendError)
|
||||
Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return NULL;
|
||||
@@ -47,8 +47,8 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
|
||||
uint32 guildId;
|
||||
recvPacket >> guildId;
|
||||
// Use received guild id to access guild method (not player's guild id)
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId))
|
||||
pGuild->HandleQuery(this);
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(guildId))
|
||||
guild->HandleQuery(this);
|
||||
else
|
||||
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
}
|
||||
@@ -62,11 +62,11 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (!GetPlayer()->GetGuildId()) // Player cannot be in guild
|
||||
{
|
||||
Guild* pGuild = new Guild();
|
||||
if (pGuild->Create(GetPlayer(), name))
|
||||
sGuildMgr->AddGuild(pGuild);
|
||||
Guild* guild = new Guild();
|
||||
if (guild->Create(GetPlayer(), name))
|
||||
sGuildMgr->AddGuild(guild);
|
||||
else
|
||||
delete pGuild;
|
||||
delete guild;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> invitedName;
|
||||
|
||||
if (normalizePlayerName(invitedName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleInviteMember(this, invitedName);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleInviteMember(this, invitedName);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
@@ -90,8 +90,8 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> playerName;
|
||||
|
||||
if (normalizePlayerName(playerName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleRemoveMember(this, playerName);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleRemoveMember(this, playerName);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
||||
@@ -100,8 +100,8 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
|
||||
// Player cannot be in guild
|
||||
if (!GetPlayer()->GetGuildId())
|
||||
// Guild where player was invited must exist
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
|
||||
pGuild->HandleAcceptMember(this);
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
|
||||
guild->HandleAcceptMember(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
|
||||
@@ -116,16 +116,16 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->SendInfo(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->SendInfo(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleRoster(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleRoster(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
@@ -136,8 +136,8 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> playerName;
|
||||
|
||||
if (normalizePlayerName(playerName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleUpdateMemberRank(this, playerName, false);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleUpdateMemberRank(this, playerName, false);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
@@ -148,24 +148,24 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> playerName;
|
||||
|
||||
if (normalizePlayerName(playerName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleUpdateMemberRank(this, playerName, true);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleUpdateMemberRank(this, playerName, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEAVE");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleLeaveMember(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleLeaveMember(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DISBAND");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleDisband(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleDisband(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
@@ -176,8 +176,8 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> name;
|
||||
|
||||
if (normalizePlayerName(name))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleSetLeader(this, name);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleSetLeader(this, name);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
|
||||
@@ -188,8 +188,8 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
|
||||
if (!recvPacket.empty())
|
||||
recvPacket >> motd;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleSetMOTD(this, motd);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleSetMOTD(this, motd);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
@@ -203,8 +203,8 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> publicNote;
|
||||
|
||||
if (normalizePlayerName(playerName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleSetMemberNote(this, playerName, publicNote, false);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleSetMemberNote(this, playerName, publicNote, false);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
@@ -218,16 +218,16 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
recvPacket >> officerNote;
|
||||
|
||||
if (normalizePlayerName(playerName))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleSetMemberNote(this, playerName, officerNote, true);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleSetMemberNote(this, playerName, officerNote, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_RANK");
|
||||
|
||||
Guild* pGuild = _GetPlayerGuild(this, true);
|
||||
if (!pGuild)
|
||||
Guild* guild = _GetPlayerGuild(this, true);
|
||||
if (!guild)
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos());
|
||||
return;
|
||||
@@ -257,7 +257,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
|
||||
rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(bankRights), slots);
|
||||
}
|
||||
|
||||
pGuild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots);
|
||||
guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
|
||||
@@ -267,16 +267,16 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
|
||||
std::string rankName;
|
||||
recvPacket >> rankName;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleAddNewRank(this, rankName);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleAddNewRank(this, rankName);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEL_RANK");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleRemoveLowestRank(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleRemoveLowestRank(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
@@ -286,8 +286,8 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
|
||||
std::string info;
|
||||
recvPacket >> info;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this, true))
|
||||
pGuild->HandleSetInfo(this, info);
|
||||
if (Guild* guild = _GetPlayerGuild(this, true))
|
||||
guild->HandleSetInfo(this, info);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
@@ -306,10 +306,10 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleSetEmblem(this, emblemInfo);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleSetEmblem(this, emblemInfo);
|
||||
else
|
||||
// "You are not part of a pGuild!";
|
||||
// "You are not part of a guild!";
|
||||
Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_NOGUILD);
|
||||
}
|
||||
else
|
||||
@@ -324,24 +324,24 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendEventLog(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendEventLog(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendMoneyInfo(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendMoneyInfo(this);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_PERMISSIONS)");
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendPermissions(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendPermissions(this);
|
||||
}
|
||||
|
||||
// Called when clicking on Guild bank gameobject
|
||||
@@ -357,14 +357,14 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data)
|
||||
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
{
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendBankTabsInfo(this);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendBankTabsInfo(this);
|
||||
else
|
||||
Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD);
|
||||
}
|
||||
}
|
||||
|
||||
// Called when opening pGuild bank tab only (first one)
|
||||
// Called when opening guild bank tab only (first one)
|
||||
void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)");
|
||||
@@ -379,8 +379,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
|
||||
recv_data >> unk1;
|
||||
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendBankTabData(this, tabId);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendBankTabData(this, tabId);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
|
||||
@@ -395,8 +395,8 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
|
||||
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
if (money && GetPlayer()->HasEnoughMoney(money))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleMemberDepositMoney(this, money);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleMemberDepositMoney(this, money);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
|
||||
@@ -411,8 +411,8 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
|
||||
|
||||
if (money)
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleMemberWithdrawMoney(this, money);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleMemberWithdrawMoney(this, money);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
@@ -428,8 +428,8 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Guild* pGuild = _GetPlayerGuild(this);
|
||||
if (!pGuild)
|
||||
Guild* guild = _GetPlayerGuild(this);
|
||||
if (!guild)
|
||||
{
|
||||
recv_data.rfinish(); // Prevent additional spam at rejected packet
|
||||
return;
|
||||
@@ -459,7 +459,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
|
||||
recv_data >> splitedAmount;
|
||||
|
||||
pGuild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount);
|
||||
guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -492,7 +492,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
|
||||
if (!Player::IsInventoryPos(playerBag, playerSlotId) && !(playerBag == NULL_BAG && playerSlotId == NULL_SLOT))
|
||||
GetPlayer()->SendEquipError(EQUIP_ERR_NONE, NULL);
|
||||
else
|
||||
pGuild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount);
|
||||
guild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,8 +507,8 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data)
|
||||
recv_data >> tabId;
|
||||
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleBuyBankTab(this, tabId);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleBuyBankTab(this, tabId);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data)
|
||||
@@ -529,8 +529,8 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data)
|
||||
|
||||
if (!name.empty() && !icon.empty())
|
||||
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->HandleSetBankTabInfo(this, tabId, name, icon);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->HandleSetBankTabInfo(this, tabId, name, icon);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data)
|
||||
@@ -540,8 +540,8 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data)
|
||||
uint8 tabId;
|
||||
recv_data >> tabId;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendBankLog(this, tabId);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendBankLog(this, tabId);
|
||||
}
|
||||
|
||||
void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
|
||||
@@ -551,8 +551,8 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data)
|
||||
uint8 tabId;
|
||||
recv_data >> tabId;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SendBankTabText(this, tabId);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SendBankTabText(this, tabId);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
|
||||
@@ -565,6 +565,6 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data)
|
||||
std::string text;
|
||||
recv_data >> text;
|
||||
|
||||
if (Guild* pGuild = _GetPlayerGuild(this))
|
||||
pGuild->SetBankTabText(tabId, text);
|
||||
if (Guild* guild = _GetPlayerGuild(this))
|
||||
guild->SetBankTabText(tabId, text);
|
||||
}
|
||||
|
||||
@@ -329,9 +329,9 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
// if the round robin player release, reset it.
|
||||
if (player->GetGUID() == loot->roundRobinPlayer)
|
||||
{
|
||||
if (Group* pGroup = player->GetGroup())
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
if (pGroup->GetLootMethod() != MASTER_LOOT)
|
||||
if (group->GetLootMethod() != MASTER_LOOT)
|
||||
{
|
||||
loot->roundRobinPlayer = 0;
|
||||
}
|
||||
@@ -405,12 +405,12 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
// if the round robin player release, reset it.
|
||||
if (player->GetGUID() == loot->roundRobinPlayer)
|
||||
{
|
||||
if (Group* pGroup = player->GetGroup())
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
if (pGroup->GetLootMethod() != MASTER_LOOT)
|
||||
if (group->GetLootMethod() != MASTER_LOOT)
|
||||
{
|
||||
loot->roundRobinPlayer = 0;
|
||||
pGroup->SendLooter(pCreature, NULL);
|
||||
group->SendLooter(pCreature, NULL);
|
||||
|
||||
// force update of dynamic flags, otherwise other group's players still not able to loot.
|
||||
pCreature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
|
||||
|
||||
@@ -1464,13 +1464,13 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data)
|
||||
void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES");
|
||||
Group* pGroup = _player->GetGroup();
|
||||
if (pGroup)
|
||||
Group* group = _player->GetGroup();
|
||||
if (group)
|
||||
{
|
||||
if (pGroup->IsLeader(_player->GetGUID()))
|
||||
if (group->IsLeader(_player->GetGUID()))
|
||||
{
|
||||
pGroup->ResetInstances(INSTANCE_RESET_ALL, false, _player);
|
||||
pGroup->ResetInstances(INSTANCE_RESET_ALL, true, _player);
|
||||
group->ResetInstances(INSTANCE_RESET_ALL, false, _player);
|
||||
group->ResetInstances(INSTANCE_RESET_ALL, true, _player);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1504,12 +1504,12 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
Group* pGroup = _player->GetGroup();
|
||||
if (pGroup)
|
||||
Group* group = _player->GetGroup();
|
||||
if (group)
|
||||
{
|
||||
if (pGroup->IsLeader(_player->GetGUID()))
|
||||
if (group->IsLeader(_player->GetGUID()))
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupGuy = itr->getSource();
|
||||
if (!pGroupGuy)
|
||||
@@ -1527,8 +1527,8 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
// the difficulty is set even if the instances can't be reset
|
||||
//_player->SendDungeonDifficulty(true);
|
||||
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
|
||||
pGroup->SetDungeonDifficulty(Difficulty(mode));
|
||||
group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
|
||||
group->SetDungeonDifficulty(Difficulty(mode));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1562,12 +1562,12 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
|
||||
if (Difficulty(mode) == _player->GetRaidDifficulty())
|
||||
return;
|
||||
|
||||
Group* pGroup = _player->GetGroup();
|
||||
if (pGroup)
|
||||
Group* group = _player->GetGroup();
|
||||
if (group)
|
||||
{
|
||||
if (pGroup->IsLeader(_player->GetGUID()))
|
||||
if (group->IsLeader(_player->GetGUID()))
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupGuy = itr->getSource();
|
||||
if (!pGroupGuy)
|
||||
@@ -1585,8 +1585,8 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
// the difficulty is set even if the instances can't be reset
|
||||
//_player->SendDungeonDifficulty(true);
|
||||
pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
|
||||
pGroup->SetRaidDifficulty(Difficulty(mode));
|
||||
group->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
|
||||
group->SetRaidDifficulty(Difficulty(mode));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -160,9 +160,9 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (qInfo->HasFlag(QUEST_FLAGS_PARTY_ACCEPT))
|
||||
{
|
||||
if (Group* pGroup = _player->GetGroup())
|
||||
if (Group* group = _player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
|
||||
@@ -546,9 +546,9 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
|
||||
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId))
|
||||
{
|
||||
if (Group* pGroup = _player->GetGroup())
|
||||
if (Group* group = _player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
|
||||
|
||||
@@ -441,8 +441,8 @@ void WorldSession::LogoutPlayer(bool Save)
|
||||
HandleMoveWorldportAckOpcode();
|
||||
|
||||
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
|
||||
if (Guild* pGuild = sGuildMgr->GetGuildById(_player->GetGuildId()))
|
||||
pGuild->HandleMemberLogout(this);
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))
|
||||
guild->HandleMemberLogout(this);
|
||||
|
||||
///- Remove pet
|
||||
_player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);
|
||||
|
||||
@@ -2665,10 +2665,10 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
|
||||
Player* targetPlayer = m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER
|
||||
? (Player*)m_targets.GetUnitTarget() : NULL;
|
||||
|
||||
Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : NULL;
|
||||
if (pGroup)
|
||||
Group* group = targetPlayer ? targetPlayer->GetGroup() : NULL;
|
||||
if (group)
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
|
||||
@@ -3328,9 +3328,9 @@ void Spell::EffectDispel(SpellEffIndex effIndex)
|
||||
int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue();
|
||||
m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true);
|
||||
// Glyph of Felhunter
|
||||
if (Unit* pOwner = m_caster->GetOwner())
|
||||
if (pOwner->GetAura(56249))
|
||||
pOwner->CastCustomSpell(pOwner, 19658, &heal_amount, NULL, NULL, true);
|
||||
if (Unit* owner = m_caster->GetOwner())
|
||||
if (owner->GetAura(56249))
|
||||
owner->CastCustomSpell(owner, 19658, &heal_amount, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ public:
|
||||
if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED)
|
||||
return false;
|
||||
|
||||
if (Group* pGroup = player->GetGroup())
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupie = itr->getSource();
|
||||
if (!pGroupie)
|
||||
|
||||
@@ -95,9 +95,9 @@ public:
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER)
|
||||
if (me->HealthBelowPctDamaged(30, damage))
|
||||
{
|
||||
if (Group* pGroup = CAST_PLR(done_by)->GetGroup())
|
||||
if (Group* group = CAST_PLR(done_by)->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pGroupie = itr->getSource();
|
||||
if (pGroupie &&
|
||||
|
||||
Reference in New Issue
Block a user