Advertisement
Guest User

Untitled

a guest
May 29th, 2017
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.55 KB | None | 0 0
  1. # HG changeset patch
  2. # User Spp <spp@jorge.gr>
  3. # Date 1275683219 -7200
  4. # Branch trunk
  5. # Node ID 898c858634edbec498ac942f5359ee4eb0e49181
  6. # Parent  9a412c09867bc6f315ebd30bdfa795baae1f0097
  7. Dungeon Finder: Fix Rolecheck error when more than 3 players selected dps.
  8. Thanks to Aokromes for pointing it out and patch testing.
  9.  
  10. diff -r 9a412c09867b -r 898c858634ed src/game/LFGMgr.cpp
  11. --- a/src/game/LFGMgr.cpp   Fri Jun 04 13:33:16 2010 -0600
  12. +++ b/src/game/LFGMgr.cpp   Fri Jun 04 22:26:59 2010 +0200
  13. @@ -590,9 +590,10 @@
  14.  /// <summary>
  15.  /// Check if a group can be formed with the given group
  16.  /// </summary>
  17. -/// <param name="grp">Group</param>
  18. +/// <param name="groles">Map of roles</param>
  19. +/// <param name="firstCall">bool, will be used to remove ROLE_LEADER</param>
  20.  /// <returns>bool</returns>
  21. -bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles)
  22. +bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag /*= true*/)
  23.  {
  24.      if (!groles.size())
  25.          return false;
  26. @@ -606,15 +607,20 @@
  27.      uint64 guid = 0;
  28.      uint8 role = 0;
  29.  
  30. +    if (removeLeaderFlag)
  31. +        for (LfgRolesMap::iterator it = groles.begin(); it != groles.end(); ++it)
  32. +            it->second &= ~ROLE_LEADER;
  33. +
  34.      for (LfgRolesMap::const_iterator it = groles.begin(); it != groles.end(); ++it)
  35.      {
  36.          guid = it->first;
  37.          role = it->second;
  38.  
  39. -        if (role == ROLE_NONE || role == ROLE_LEADER)
  40. +        if (role == ROLE_NONE)
  41.              return false;
  42.  
  43.          if (role & ROLE_TANK)
  44. +        {
  45.              if (!tank)
  46.              {
  47.                  tguid = guid;
  48. @@ -625,10 +631,12 @@
  49.                  if (groles[tguid] == ROLE_TANK)
  50.                      tguid = guid;
  51.                  groles[tguid] -= ROLE_TANK;
  52. -                return CheckGroupRoles(groles);
  53. +                return CheckGroupRoles(groles, false);
  54.              }
  55. +        }
  56.  
  57.          if (role & ROLE_HEALER)
  58. +        {
  59.              if (!healer)
  60.              {
  61.                  hguid = guid;
  62. @@ -639,10 +647,12 @@
  63.                  if (groles[hguid] == ROLE_HEALER)
  64.                      hguid = guid;
  65.                  groles[hguid] -= ROLE_HEALER;
  66. -                return CheckGroupRoles(groles);
  67. +                return CheckGroupRoles(groles, false);
  68.              }
  69. +        }
  70.  
  71.          if (role & ROLE_DAMAGE)
  72. +        {
  73.              if (damage < 3)
  74.              {
  75.                  if (!damage)
  76. @@ -654,8 +664,12 @@
  77.                  if (groles[dguid] == ROLE_DAMAGE)
  78.                      dguid = guid;
  79.                  groles[dguid] -= ROLE_DAMAGE;
  80. -                return CheckGroupRoles(groles);
  81. +                if (!CheckGroupRoles(groles, false))
  82. +                    groles[dguid] += ROLE_DAMAGE;
  83. +                else
  84. +                    return true;
  85.              }
  86. +        }
  87.      }
  88.      return true;
  89.  }
  90. diff -r 9a412c09867b -r 898c858634ed src/game/LFGMgr.h
  91. --- a/src/game/LFGMgr.h Fri Jun 04 13:33:16 2010 -0600
  92. +++ b/src/game/LFGMgr.h Fri Jun 04 22:26:59 2010 +0200
  93. @@ -255,7 +255,7 @@
  94.      void BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr);
  95.      void BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet);
  96.      void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap);
  97. -    bool CheckGroupRoles(LfgRolesMap &groles);
  98. +    bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true);
  99.  
  100.      LfgLockStatusMap* GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons);
  101.      LfgLockStatusSet* GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement