Entities/Unit: Fix an issue where Unit pointers could be left dangling if a channeled Charm was interrupted by a control aura application.

Port From (https://github.com/TrinityCore/TrinityCore/commit/d10554da14fb8371072567f673c9f919cbe6b929)
This commit is contained in:
hondacrx
2021-12-23 20:19:55 -05:00
parent 1f58dc2b53
commit e28b42b270
3 changed files with 7 additions and 12 deletions
+4
View File
@@ -7217,7 +7217,11 @@ namespace Game.Entities
{
// 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))
{
// this should never happen, otherwise m_unitBeingMoved might be left dangling!
Cypher.Assert(GetUnitBeingMoved() == target);
return;
}
ControlUpdate packet = new();
packet.Guid = target.GetGUID();