Changeset 132 for trunk/src/game/Group.h

Show
Ignore:
Timestamp:
11/19/08 13:39:06 (17 years ago)
Author:
yumileroy
Message:

[svn] * Added npc follow, waterwalk, repairitems commands. Patch by dythzer
* Prevent adding more than 5 people to raid - Apoc
* fixed typo from one of our previous commits.
* Fixed two strings in core, thanx to warhead for patch.

Original author: KingPin?
Date: 2008-10-29 17:09:32-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Group.h

    r111 r132  
    184184 
    185185        // member manipulation methods 
    186         bool IsMember(uint64 guid) const { return _getMemberCSlot(guid) != m_memberSlots.end(); } 
    187         bool IsLeader(uint64 guid) const { return (GetLeaderGUID() == guid); } 
     186        bool IsMember(const uint64& guid) const { return _getMemberCSlot(guid) != m_memberSlots.end(); } 
     187                bool IsLeader(const uint64& guid) const { return (GetLeaderGUID() == guid); } 
    188188        bool IsAssistant(uint64 guid) const 
    189189        { 
     
    195195        } 
    196196 
    197         bool SameSubGroup(uint64 guid1, uint64 guid2) const 
     197        bool SameSubGroup(uint64 guid1,const uint64& guid2) const 
    198198        { 
    199199            member_citerator mslot2 = _getMemberCSlot(guid2); 
     
    212212            return (mslot1->group==slot2->group); 
    213213        } 
     214                 
     215                bool HasFreeSlotSubGroup(uint8 subgroup) const 
     216                { 
     217                        return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); 
     218                } 
    214219 
    215220        bool SameSubGroup(Player const* member1, Player const* member2) const; 
     
    229234 
    230235        // some additional raid methods 
    231         void ConvertToRaid() 
    232         { 
    233             _convertToRaid(); 
    234             SendUpdate(); 
    235         } 
     236        void ConvertToRaid(); 
     237 
    236238        void SetBattlegroundGroup(BattleGround *bg) { m_bgGroup = bg; } 
    237239        uint32 CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); 
     
    240242        void ChangeMembersGroup(Player *player, const uint8 &group); 
    241243 
    242         void SetAssistant(const uint64 &guid, const bool &state) 
     244        void SetAssistant(uint64 guid, const bool &state) 
    243245        { 
    244246            if(!isRaidGroup()) 
     
    247249                SendUpdate(); 
    248250        } 
    249         void SetMainTank(const uint64 &guid) 
     251        void SetMainTank(uint64 guid) 
    250252        { 
    251253            if(!isRaidGroup()) 
     
    255257                SendUpdate(); 
    256258        } 
    257         void SetMainAssistant(const uint64 &guid) 
     259        void SetMainAssistant(uint64 guid) 
    258260        { 
    259261            if(!isRaidGroup()) 
     
    286288 
    287289        void SendLootStartRoll(uint32 CountDown, const Roll &r); 
    288         void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 
    289         void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 
     290        void SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 
     291        void SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 
    290292        void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r); 
    291         void GroupLoot(uint64 playerGUID, Loot *loot, Creature *creature); 
    292         void NeedBeforeGreed(uint64 playerGUID, Loot *loot, Creature *creature); 
    293         void MasterLoot(uint64 playerGUID, Loot *loot, Creature *creature); 
     293        void GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature); 
     294                void NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature); 
     295                void MasterLoot(const uint64& playerGUID, Loot *loot, Creature *creature); 
    294296        Rolls::iterator GetRoll(uint64 Guid) 
    295297        { 
     
    305307        } 
    306308        void CountTheRoll(Rolls::iterator roll, uint32 NumberOfPlayers); 
    307         void CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choise); 
     309        void CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 NumberOfPlayers, uint8 Choise); 
    308310        void EndRoll(); 
    309311 
     
    324326        void _removeRolls(const uint64 &guid); 
    325327 
    326         void _convertToRaid(); 
    327328        bool _setMembersGroup(const uint64 &guid, const uint8 &group); 
    328329        bool _setAssistantFlag(const uint64 &guid, const bool &state); 
     
    331332 
    332333        void _homebindIfInstance(Player *player); 
     334                 
     335                void _initRaidSubGroupsCounter() 
     336                { 
     337                        // Sub group counters initialization 
     338                        if (!m_subGroupsCounts) 
     339                                m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE]; 
     340                                 
     341                        memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8)); 
     342                         
     343                        for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) 
     344                                ++m_subGroupsCounts[itr->group]; 
     345                } 
    333346 
    334347        member_citerator _getMemberCSlot(uint64 Guid) const 
     
    351364            return m_memberSlots.end(); 
    352365        } 
     366                 
     367                void SubGroupCounterIncrease(uint8 subgroup) 
     368                { 
     369                        if (m_subGroupsCounts) 
     370                                ++m_subGroupsCounts[subgroup]; 
     371                } 
     372                 
     373                void SubGroupCounterDecrease(uint8 subgroup) 
     374                { 
     375                        if (m_subGroupsCounts) 
     376                                --m_subGroupsCounts[subgroup]; 
     377                } 
    353378 
    354379        MemberSlotList      m_memberSlots; 
     
    368393        Rolls               RollId; 
    369394        BoundInstancesMap   m_boundInstances[TOTAL_DIFFICULTIES]; 
     395                uint8*              m_subGroupsCounts; 
    370396}; 
    371397#endif