Core/Entities: unit states cleanup

Port From (https://github.com/TrinityCore/TrinityCore/commit/70c26d53cb94f0e78a57ecc2279c960370891aa4)
This commit is contained in:
hondacrx
2021-08-08 23:44:54 -04:00
parent 26a2eced6e
commit b039353f1a
5 changed files with 51 additions and 39 deletions
+5
View File
@@ -7231,6 +7231,10 @@ namespace Game.Entities
public void SetClientControl(Unit target, bool allowMove)
{
// still affected by some aura that shouldn't allow control, only allow on last such aura to be removed
if (allowMove && target.HasUnitState(UnitState.CantClientControl))
return;
ControlUpdate packet = new();
packet.Guid = target.GetGUID();
packet.On = allowMove;
@@ -7242,6 +7246,7 @@ namespace Game.Entities
if (allowMove)
SetMover(target);
}
public void SetMover(Unit target)
{
m_unitMovedByMe.m_playerMovingMe = null;