*Creature Groups - additional checks added.(hope it fix the crash). VC71 VC80 updated.

--HG--
branch : trunk
This commit is contained in:
2008-12-16 09:39:33 +02:00
parent 827b706028
commit e4be94461b
5 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -627,7 +627,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
void SearchFormation();
bool IsFormationLeader() {return GetDBTableGUIDLow() == m_formationID;}
bool IsFormationLeader() {return (GetDBTableGUIDLow() && GetDBTableGUIDLow() == m_formationID);}
uint32 GetFormationID(){return m_formationID;}
protected:
+3 -2
View File
@@ -80,8 +80,9 @@ template<>
inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
{
//Call for creature group update
if(i_traveller.IsFormationLeader() && !i_traveller.isInCombat())
CreatureGroupHolder[i_traveller.GetFormationID()]->LeaderMovedInEvade();
if(i_traveller.IsFormationLeader() && !i_traveller.isInCombat() &&
CreatureGroupHolder.find(i_traveller.GetFormationID()) != CreatureGroupHolder.end())
CreatureGroupHolder[i_traveller.GetFormationID()]->LeaderMovedInEvade();
i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
}
+2 -1
View File
@@ -9688,7 +9688,8 @@ void Unit::CombatStart(Unit* target)
target->SetStandState(PLAYER_STATE_NONE);
//Call creature group update
if(GetTypeId()==TYPEID_UNIT && ((Creature *)this)->GetFormationID())
if(GetTypeId()==TYPEID_UNIT && ((Creature *)this)->GetFormationID() &&
CreatureGroupHolder.find(((Creature *)this)->GetFormationID()) != CreatureGroupHolder.end())
CreatureGroupHolder[((Creature *)this)->GetFormationID()]->MemberHasAttacked(((Creature *)this));
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER