Core/Unit: Added helper functions to modify UNIT_FLAG2_CANNOT_TURN

Port From (https://github.com/TrinityCore/TrinityCore/commit/53f9abec14613c0823b1ee5363b3f873cc23ece9)
This commit is contained in:
hondacrx
2023-09-04 07:22:22 -04:00
parent 8bf185f071
commit 15fe47e0cb
2 changed files with 14 additions and 4 deletions
+11 -1
View File
@@ -684,7 +684,17 @@ namespace Game.Entities
}
}
bool IsThreatened()
public bool CannotTurn() { return HasUnitFlag2(UnitFlags2.CannotTurn); }
public void SetCannotTurn(bool apply)
{
if (apply)
SetUnitFlag2(UnitFlags2.CannotTurn);
else
RemoveUnitFlag2(UnitFlags2.CannotTurn);
}
public bool IsThreatened()
{
return !m_threatManager.IsThreatListEmpty();
}