Core/Groups: Move OnGroupChangeLeader so it could be triggered when a leader leaves a group

--HG--
branch : trunk
This commit is contained in:
Spp
2010-10-19 19:17:36 +02:00
parent 959ef0878a
commit 8996a10f6c

View File

@@ -431,7 +431,6 @@ void Group::ChangeLeader(const uint64 &guid)
if (slot == m_memberSlots.end())
return;
sScriptMgr.OnGroupChangeLeader(this, m_leaderGuid, guid);
_setLeader(guid);
WorldPacket data(SMSG_GROUP_SET_LEADER, slot->name.size()+1);
@@ -1332,6 +1331,8 @@ void Group::_setLeader(const uint64 &guid)
if (slot == m_memberSlots.end())
return;
sScriptMgr.OnGroupChangeLeader(this, m_leaderGuid, guid);
if (!isBGGroup())
{
// TODO: set a time limit to have this function run rarely cause it can be slow