fix(Core/Unit): adds in formation not attacking when leader killed (#7412)

Co-authored-by: John Smith <mostdefinitelyanagger@outlook.com>
This commit is contained in:
jestermaniac
2021-08-22 13:32:27 +02:00
committed by GitHub
parent e8d8050330
commit 5f6780532f
3 changed files with 16 additions and 9 deletions

View File

@@ -933,7 +933,7 @@ void Creature::Motion_Initialize()
GetMotionMaster()->Initialize();
else if (m_formation->getLeader() == this)
{
m_formation->FormationReset(false);
m_formation->FormationReset(false, true);
GetMotionMaster()->Initialize();
}
else if (m_formation->isFormed())
@@ -1759,7 +1759,7 @@ void Creature::setDeathState(DeathState s, bool despawn)
//Dismiss group if is leader
if (m_formation && m_formation->getLeader() == this)
m_formation->FormationReset(true);
m_formation->FormationReset(true, false);
bool needsFalling = !despawn && (IsFlying() || IsHovering()) && !IsUnderWater();
SetHover(false);