Core/Unit: Some charm fixes:

Port From (https://github.com/TrinityCore/TrinityCore/commit/34f9666f209ab3f281bf81de92c4bc1a164b0059)
This commit is contained in:
hondacrx
2021-11-02 14:14:58 -04:00
parent 430d163dee
commit 78a466e5b6
5 changed files with 45 additions and 45 deletions
+4 -3
View File
@@ -41,10 +41,11 @@ namespace Game.Entities
for (var i = 0; i < SharedConst.ActionBarIndexMax; ++i)
PetActionBar[i] = new UnitActionBarEntry();
if (_unit.IsTypeId(TypeId.Unit))
Creature creature = _unit.ToCreature();
if (creature != null)
{
_oldReactState = _unit.ToCreature().GetReactState();
_unit.ToCreature().SetReactState(ReactStates.Passive);
_oldReactState = creature.GetReactState();
creature.SetReactState(ReactStates.Passive);
}
}