Fix possible bug occuring during shuffling of raid subgroups, and prevent client side exploit. Author: Vladimir.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-22 00:42:31 +02:00
parent 4e361d0d9b
commit eefe75a31f
3 changed files with 31 additions and 19 deletions
+4 -3
View File
@@ -33,6 +33,7 @@
#define MAXGROUPSIZE 5
#define MAXRAIDSIZE 40
#define MAX_RAID_SUBGROUPS MAXRAIDSIZE/MAXGROUPSIZE
#define TARGETICONCOUNT 8
enum RollVote
@@ -260,7 +261,7 @@ class Group
{
member_citerator mslot = _getMemberCSlot(guid);
if (mslot == m_memberSlots.end())
return (MAXRAIDSIZE/MAXGROUPSIZE+1);
return (MAX_RAID_SUBGROUPS+1);
return mslot->group;
}
@@ -381,9 +382,9 @@ class Group
{
// Sub group counters initialization
if (!m_subGroupsCounts)
m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE];
m_subGroupsCounts = new uint8[MAX_RAID_SUBGROUPS];
memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8));
memset((void*)m_subGroupsCounts, 0, (MAX_RAID_SUBGROUPS)*sizeof(uint8));
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
++m_subGroupsCounts[itr->group];