Small update to the group/party system.

- Fixes raid assistant privileges, Fixes issue #248
- Proper designation for Main tank and Main assistant roles
- Remove 2 redundant columns in DB, namely groups.mainTank and groups.mainAssist. These are now defined by the value of group_member.memberFlags

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-03-09 20:33:59 +01:00
parent e5eaa46a7f
commit 24ab54f213
6 changed files with 48 additions and 56 deletions

View File

@@ -522,7 +522,8 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
recv_data >> groupNr;
/** error handling **/
if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
uint64 senderGuid = GetPlayer()->GetGUID();
if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid))
return;
if (!group->HasFreeSlotSubGroup(groupNr))
@@ -553,12 +554,12 @@ void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
recv_data >> flag;
/** error handling **/
if(!group->IsLeader(GetPlayer()->GetGUID()))
if (!group->IsLeader(GetPlayer()->GetGUID()))
return;
/********************/
// everything's fine, do it
group->SetAssistant(guid, (flag==0?false:true));
group->SetAssistant(guid, (flag != 0));
}
void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
@@ -566,7 +567,7 @@ void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
sLog.outDebug("MSG_PARTY_ASSIGNMENT");
Group *group = GetPlayer()->GetGroup();
if(!group)
if (!group)
return;
uint8 flag, apply;
@@ -575,15 +576,16 @@ void WorldSession::HandlePartyAssignmentOpcode( WorldPacket & recv_data )
recv_data >> guid;
/** error handling **/
if(!group->IsLeader(GetPlayer()->GetGUID()))
uint64 senderGuid = GetPlayer()->GetGUID();
if (!group->IsLeader(senderGuid) && group->IsAssistant(senderGuid))
return;
/********************/
// everything's fine, do it
if (flag == MEMBER_FLAG_MAINTANK)
if (flag == 0)
group->SetMainTank(guid, apply);
else if (flag == MEMBER_FLAG_MAINASSIST)
else if (flag == 1)
group->SetMainAssistant(guid, apply);
}