From e8866340ce2cb717486c8def489ddc9d3046a0cc Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 6 Apr 2009 13:27:42 -0500 Subject: *CreatureGroups fixed and improoved. By TrullyONE - Multimap support for instances added. - Removed redundant group checks. - New movement rules (bool group formed/dismissed added). - uint32 Creature::GroupID replaced with CreatureGroup pointer. --HG-- branch : trunk --- src/game/Unit.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index def8f0c1f3a..973b2a7ea35 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9556,12 +9556,11 @@ void Unit::CombatStart(Unit* target) } //Call creature group update - if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormationID()) - { - CreatureGroupHolderType::iterator itr = CreatureGroupHolder.find(((Creature*)this)->GetFormationID()); - if(itr != CreatureGroupHolder.end()) - itr->second->MemberHasAttacked(((Creature*)this)); - } + if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormation()) + { + ((Creature*)this)->GetFormation()->MemberHasAttacked(*(Creature*)this); + sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);"); + } } void Unit::SetInCombatState(bool PvP) -- cgit v1.2.3