Entities/Unit: Properly unset engaged flag for creates that cannot have a threat list on combat exit. Fixes #23518.

(cherry picked from commit f44539b64247ff626c53dc899c4ac3023bf9aa80)
This commit is contained in:
Treeston
2021-12-14 00:07:37 +01:00
committed by Shauren
parent e0f3255f90
commit 513b35ea2f
+1 -1
View File
@@ -343,7 +343,7 @@ bool CombatManager::UpdateOwnerCombatState() const
{
_owner->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
_owner->AtExitCombat();
if (_owner->IsEngaged() && !(_owner->ToCreature() && _owner->ToCreature()->IsAIEnabled()))
if (_owner->IsEngaged() && !(_owner->ToCreature() && _owner->CanHaveThreatList() && _owner->ToCreature()->IsAIEnabled()))
_owner->AtDisengage();
}