diff options
author | Trazom62 <none@none> | 2010-05-05 13:58:25 +0200 |
---|---|---|
committer | Trazom62 <none@none> | 2010-05-05 13:58:25 +0200 |
commit | 1acb837a332ee59fb815277dfcf9626cf55d5f8b (patch) | |
tree | 1f6c5b9278334e3b2ef3d3917450c7b30cc3dea3 | |
parent | 0ccadb1a3b96f1a2e35b677cdc0c285cf3f70b7c (diff) |
Fix crash in CreatureGroup::MemberAttackStart.
Fixes issue #1982.
--HG--
branch : trunk
-rw-r--r-- | src/game/CreatureGroups.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/CreatureGroups.cpp b/src/game/CreatureGroups.cpp index 911b6d625af..c2af59458f7 100644 --- a/src/game/CreatureGroups.cpp +++ b/src/game/CreatureGroups.cpp @@ -186,8 +186,8 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target) for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); - //sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName()); + if (m_leader) // avoid crash if leader was killed and reset. + sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); //Skip one check if (itr->first == member) @@ -199,7 +199,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target) if (itr->first->getVictim()) continue; - if (itr->first->canAttack(target)) + if (itr->first->canAttack(target) && itr->first->AI()) itr->first->AI()->AttackStart(target); } } |