diff options
author | Machiavelli <none@none> | 2010-03-09 20:33:59 +0100 |
---|---|---|
committer | Machiavelli <none@none> | 2010-03-09 20:33:59 +0100 |
commit | 24ab54f213a40adb643fe0b30cd0ffa5d6f1b2b7 (patch) | |
tree | 7336e8af9a3f7c322df410d40279ae57e97a3b60 /src/game/GroupHandler.cpp | |
parent | e5eaa46a7f3f58d77b9037d8c1628a1a1a55bcd3 (diff) |
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
Diffstat (limited to 'src/game/GroupHandler.cpp')
-rw-r--r-- | src/game/GroupHandler.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index cf52bec2074..819be6dd96e 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -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); } |