diff options
-rw-r--r-- | src/game/Creature.h | 2 | ||||
-rw-r--r-- | src/game/Traveller.h | 5 | ||||
-rw-r--r-- | src/game/Unit.cpp | 3 | ||||
-rw-r--r-- | win/VC71/game.vcproj | 6 | ||||
-rw-r--r-- | win/VC80/game.vcproj | 8 |
5 files changed, 20 insertions, 4 deletions
diff --git a/src/game/Creature.h b/src/game/Creature.h index f35c833d4d8..abffa6c710a 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -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: diff --git a/src/game/Traveller.h b/src/game/Traveller.h index 9611f2ea6e6..0ac136ff677 100644 --- a/src/game/Traveller.h +++ b/src/game/Traveller.h @@ -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); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6dcc96500cc..19ea4029cf8 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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 diff --git a/win/VC71/game.vcproj b/win/VC71/game.vcproj index 722300b9e8a..923845a7612 100644 --- a/win/VC71/game.vcproj +++ b/win/VC71/game.vcproj @@ -593,6 +593,12 @@ RelativePath="..\..\src\game\CreatureAISelector.h"> </File> <File + RelativePath="..\..\src\game\CreatureGroups.cpp"> + </File> + <File + RelativePath="..\..\src\game\CreatureGroups.h"> + </File> + <File RelativePath="..\..\src\game\DestinationHolder.cpp"> </File> <File diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index d8bd6bf726d..e456ebbf235 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -947,6 +947,14 @@ > </File> <File + RelativePath="..\..\src\game\CreatureGroups.cpp" + > + </File> + <File + RelativePath="..\..\src\game\CreatureGroups.h" + > + </File> + <File RelativePath="..\..\src\game\DestinationHolder.cpp" > </File> |