fix(Core/Units): Fixed problems with charming non-demon creatures by … (#12164)

fix(Core/Units): Fixed problems with charming non-demon creatures by warlock.

Fixed #12114
This commit is contained in:
UltraNix
2022-06-26 09:44:30 +02:00
committed by GitHub
parent 53836284c2
commit e11fea28c5

View File

@@ -17970,8 +17970,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
GetMotionMaster()->MoveIdle();
StopMoving();
if (charmer->GetTypeId() == TYPEID_PLAYER &&
charmer->getClass() == CLASS_WARLOCK)
if (charmer->GetTypeId() == TYPEID_PLAYER && charmer->getClass() == CLASS_WARLOCK && ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_DEMON)
{
// Disable CreatureAI/SmartAI and switch to CharmAI when charmed by warlock
Creature* charmed = ToCreature();