Core/Groups: Fixed UnitIsPartyLeader lua function

This commit is contained in:
Shauren committed 2014-02-04 10:57:32 +01:00
1 parent f1bfd43c58
commit 996e9115ac
2 files changed
+11

No files matched your search

@@ -18494,6 +18494,9 @@ void Player::_LoadGroup(PreparedQueryResult result)
{
if (Group* group = sGroupMgr->GetGroupByDbStoreId((*result)[0].GetUInt32()))
{
if (group->IsLeader(GetGUID()))
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
uint8 subgroup = group->GetMemberGroup(GetGUID());
SetGroup(group, subgroup);
if (getLevel() >= LEVELREQUIREMENT_HEROIC)
@@ -18504,6 +18507,9 @@ void Player::_LoadGroup(PreparedQueryResult result)
}
}
}
if (!GetGroup() || !GetGroup()->IsLeader(GetGUID()))
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
}
void Player::_LoadBoundInstances(PreparedQueryResult result)
+5
View File
@@ -99,6 +99,7 @@ bool Group::Create(Player* leader)
m_guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_GROUP);
m_leaderGuid = leaderGuid;
m_leaderName = leader->GetName();
leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
if (isBGGroup() || isBFGroup())
m_groupType = GROUPTYPE_BGRAID;
@@ -666,6 +667,10 @@ void Group::ChangeLeader(uint64 newLeaderGuid)
CharacterDatabase.CommitTransaction(trans);
}
if (Player* oldLeader = ObjectAccessor::FindPlayer(m_leaderGuid))
oldLeader->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
newLeader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
m_leaderGuid = newLeader->GetGUID();
m_leaderName = newLeader->GetName();
ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, false);