fix(Core/Spells): MC should work on mounted targets (#23905)

This commit is contained in:
thomasjteachey 2025-11-26 20:19:01 -05:00 committed by GitHub
parent dfe44b7e86
commit 4d16a5ccee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

BIN
src.zip Normal file

Binary file not shown.

View file

@ -18388,7 +18388,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
}
// dismount players when charmed
if (IsPlayer())
if (IsPlayer() && type != CHARM_TYPE_POSSESS)
RemoveAurasByType(SPELL_AURA_MOUNTED);
if (charmer->IsPlayer())

View file

@ -6609,8 +6609,13 @@ SpellCastResult Spell::CheckCast(bool strict)
if (target->IsCreature() && target->ToCreature()->IsVehicle())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
// Allow SPELL_AURA_MOD_POSSESS to work on mounted players,
// but keep the old restriction for everything else.
if (target->IsMounted())
return SPELL_FAILED_CANT_BE_CHARMED;
{
if (!(target->IsPlayer() && m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_POSSESS))
return SPELL_FAILED_CANT_BE_CHARMED;
}
if (target->GetCharmerGUID())
return SPELL_FAILED_CHARMED;
@ -7905,7 +7910,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const
case SPELL_AURA_AOE_CHARM:
if (target->IsCreature() && target->IsVehicle())
return false;
if (target->IsMounted())
if (target->IsMounted() && m_spellInfo->Effects[eff].ApplyAuraName != SPELL_AURA_MOD_POSSESS)
return false;
if (target->GetCharmerGUID())
return false;