Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # HG changeset patch
- # User Spp <spp@jorge.gr>
- # Date 1275683219 -7200
- # Branch trunk
- # Node ID 898c858634edbec498ac942f5359ee4eb0e49181
- # Parent 9a412c09867bc6f315ebd30bdfa795baae1f0097
- Dungeon Finder: Fix Rolecheck error when more than 3 players selected dps.
- Thanks to Aokromes for pointing it out and patch testing.
- diff -r 9a412c09867b -r 898c858634ed src/game/LFGMgr.cpp
- --- a/src/game/LFGMgr.cpp Fri Jun 04 13:33:16 2010 -0600
- +++ b/src/game/LFGMgr.cpp Fri Jun 04 22:26:59 2010 +0200
- @@ -590,9 +590,10 @@
- /// <summary>
- /// Check if a group can be formed with the given group
- /// </summary>
- -/// <param name="grp">Group</param>
- +/// <param name="groles">Map of roles</param>
- +/// <param name="firstCall">bool, will be used to remove ROLE_LEADER</param>
- /// <returns>bool</returns>
- -bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles)
- +bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag /*= true*/)
- {
- if (!groles.size())
- return false;
- @@ -606,15 +607,20 @@
- uint64 guid = 0;
- uint8 role = 0;
- + if (removeLeaderFlag)
- + for (LfgRolesMap::iterator it = groles.begin(); it != groles.end(); ++it)
- + it->second &= ~ROLE_LEADER;
- +
- for (LfgRolesMap::const_iterator it = groles.begin(); it != groles.end(); ++it)
- {
- guid = it->first;
- role = it->second;
- - if (role == ROLE_NONE || role == ROLE_LEADER)
- + if (role == ROLE_NONE)
- return false;
- if (role & ROLE_TANK)
- + {
- if (!tank)
- {
- tguid = guid;
- @@ -625,10 +631,12 @@
- if (groles[tguid] == ROLE_TANK)
- tguid = guid;
- groles[tguid] -= ROLE_TANK;
- - return CheckGroupRoles(groles);
- + return CheckGroupRoles(groles, false);
- }
- + }
- if (role & ROLE_HEALER)
- + {
- if (!healer)
- {
- hguid = guid;
- @@ -639,10 +647,12 @@
- if (groles[hguid] == ROLE_HEALER)
- hguid = guid;
- groles[hguid] -= ROLE_HEALER;
- - return CheckGroupRoles(groles);
- + return CheckGroupRoles(groles, false);
- }
- + }
- if (role & ROLE_DAMAGE)
- + {
- if (damage < 3)
- {
- if (!damage)
- @@ -654,8 +664,12 @@
- if (groles[dguid] == ROLE_DAMAGE)
- dguid = guid;
- groles[dguid] -= ROLE_DAMAGE;
- - return CheckGroupRoles(groles);
- + if (!CheckGroupRoles(groles, false))
- + groles[dguid] += ROLE_DAMAGE;
- + else
- + return true;
- }
- + }
- }
- return true;
- }
- diff -r 9a412c09867b -r 898c858634ed src/game/LFGMgr.h
- --- a/src/game/LFGMgr.h Fri Jun 04 13:33:16 2010 -0600
- +++ b/src/game/LFGMgr.h Fri Jun 04 22:26:59 2010 +0200
- @@ -255,7 +255,7 @@
- void BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr);
- void BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet);
- void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap);
- - bool CheckGroupRoles(LfgRolesMap &groles);
- + bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true);
- LfgLockStatusMap* GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons);
- LfgLockStatusSet* GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement