fix(Core/Creature): Fixed GroupAI flags usage in creature_formations (#7544)

* fix(Core/Creature): Fixed GroupAI flags usage

* fix(Core/Creature): build fix + code style...

* fix(Core/Creatures): trailing white spaces...

* Core/Formations: allow only certain members to have follow formation

* Core/Formations: fixed ancient data corruption in CreatureGroup::LeaderMoveTo

* Core/Formations: minor optimization

* Core/Formations: improved some warning messages

* Core/Formations: do not load invalid formation data which has unsupported group ai

* Core/Formations: minor adjust for recent commit

* Core/Formations: log formation data which has angle and distance but dont have GROUP_AI_FLAG_FOLLOW_LEADER flag

* Core/Formations: Minor optimization for formation data handling

* Core/Formations: make sure that FormationInfo members are always initialized on its creation

* Core/Formations: minor warnings adjustments

* DB/Formations: fixed some warnings

* Core/Formations: check group flags only if there is any
I have gues that maybe leader could not assist any member at all but members maybe could be linked for motion

* DB/Formations: fixed rest of DB warnings

* Core/Formations: more improvements for supported AI mask check

* Core/Formations: more improvements for data checks

* DB/Formations: fixed warnings

* meh

* DB/Formations: minor correction

* Core/Formations: code style - brackets, you suck... :D
This commit is contained in:
Andrius Peleckas
2021-09-24 20:51:55 +03:00
committed by GitHub
parent 5d08c6c64b
commit e6b1201e50
5 changed files with 177 additions and 89 deletions

View File

@@ -270,15 +270,21 @@ void Creature::DisappearAndDie()
void Creature::SearchFormation()
{
if (IsSummon())
{
return;
}
ObjectGuid::LowType spawnId = GetSpawnId();
if (!spawnId)
{
return;
}
CreatureGroupInfoType::iterator frmdata = sFormationMgr->CreatureGroupMap.find(spawnId);
CreatureGroupInfoType::const_iterator frmdata = sFormationMgr->CreatureGroupMap.find(spawnId);
if (frmdata != sFormationMgr->CreatureGroupMap.end())
sFormationMgr->AddCreatureToGroup(frmdata->second->leaderGUID, this);
{
sFormationMgr->AddCreatureToGroup(frmdata->second.leaderGUID, this);
}
}
void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)