Core/Entities: unit states cleanup
Port From (https://github.com/TrinityCore/TrinityCore/commit/70c26d53cb94f0e78a57ecc2279c960370891aa4)
This commit is contained in:
@@ -441,6 +441,8 @@ namespace Game.Entities
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AddUnitState(UnitState.Charmed);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -542,8 +544,7 @@ namespace Game.Entities
|
||||
IsAIEnabled = false;
|
||||
}
|
||||
|
||||
if (!HasUnitState(UnitState.LostControl))
|
||||
player.SetClientControl(this, true);
|
||||
player.SetClientControl(this, true);
|
||||
}
|
||||
|
||||
EngageWithTarget(charmer);
|
||||
@@ -553,6 +554,10 @@ namespace Game.Entities
|
||||
playerCharmer.SendRemoveControlBar();
|
||||
else if (IsTypeId(TypeId.Player) || (IsTypeId(TypeId.Unit) && !IsGuardian()))
|
||||
DeleteCharmInfo();
|
||||
|
||||
// reset confused movement for example
|
||||
ApplyControlStatesIfNeeded();
|
||||
ClearUnitState(UnitState.Charmed);
|
||||
}
|
||||
|
||||
public void GetAllMinionsByEntry(List<TempSummon> Minions, uint entry)
|
||||
|
||||
Reference in New Issue
Block a user