diff options
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index e04a552c335..3812ce7865a 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -182,7 +182,7 @@ void Creature::AddToWorld() m_zoneScript->OnCreatureCreate(this, true); ObjectAccessor::Instance().AddObject(this); Unit::AddToWorld(); - SearchFormationAndPath(); + SearchFormation(); AIM_Initialize(); if(IsVehicle()) GetVehicleKit()->Install(); @@ -212,7 +212,7 @@ void Creature::DisappearAndDie() RemoveCorpse(); } -void Creature::SearchFormationAndPath() +void Creature::SearchFormation() { if(isSummon()) return; @@ -221,28 +221,9 @@ void Creature::SearchFormationAndPath() if(!lowguid) return; - bool usePath = (GetDefaultMovementType() == WAYPOINT_MOTION_TYPE); CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid); if(frmdata != CreatureGroupMap.end()) - { - if(usePath && lowguid != frmdata->second->leaderGUID) - { - SetDefaultMovementType(IDLE_MOTION_TYPE); - usePath = false; - } formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this); - } - - if(usePath) - { - if(WaypointMgr.GetPath(lowguid * 10)) - SetWaypointPathId(lowguid * 10); - else - { - sLog.outErrorDb("Creature DBGUID %u has waypoint motion type, but it does not have a waypoint path!", lowguid); - SetDefaultMovementType(IDLE_MOTION_TYPE); - } - } } void Creature::RemoveCorpse() @@ -2271,6 +2252,10 @@ bool Creature::LoadCreaturesAddon(bool reload) if (cainfo->move_flags != 0) SetUnitMovementFlags(cainfo->move_flags); + //Load Path + if (cainfo->path_id != 0) + m_path_id = cainfo->path_id; + if(cainfo->auras) { for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura) |