Skip to content

Commit

Permalink
Minor refactor of HandleGroupDisbandOpcode
Browse files Browse the repository at this point in the history
Some local vars caching instead of calls
  • Loading branch information
Warlockbugs committed Jun 14, 2017
1 parent fdca58f commit fab25aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/game/GroupHandler.cpp
Expand Up @@ -361,10 +361,12 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recv_data)

void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recv_data*/)
{
if (!GetPlayer()->GetGroup())
Player* player = GetPlayer();
Group* group = player->GetGroup();
if (!group)
return;

if (_player->InBattleGround())
if (player->InBattleGround())
{
SendPartyResult(PARTY_OP_INVITE, "", ERR_INVITE_RESTRICTED);
return;
Expand All @@ -374,9 +376,9 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recv_data*/)
/********************/

// everything is fine, do it
SendPartyResult(PARTY_OP_LEAVE, GetPlayer()->GetName(), ERR_PARTY_RESULT_OK);
SendPartyResult(PARTY_OP_LEAVE, player->GetName(), ERR_PARTY_RESULT_OK);

GetPlayer()->RemoveFromGroup();
player->RemoveFromGroup();
}

void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
Expand Down

0 comments on commit fab25aa

Please sign in to comment.