Add LOS check with NPC::AICheckCloseBeneficialSpells [skip ci]

This commit is contained in:
Akkadius 2020-03-11 01:39:08 -05:00
parent 785804a936
commit 240d5c2a66

View File

@ -3093,6 +3093,14 @@ bool NPC::AICheckCloseBeneficialSpells(
continue;
}
if (!mob->CheckLosFN(caster)) {
continue;
}
if (mob->GetReverseFactionCon(caster) >= FACTION_KINDLY) {
continue;
}
LogAICastBeneficialClose(
"NPC [{}] Distance [{}] Cast Range [{}] Caster [{}]",
mob->GetCleanName(),
@ -3101,10 +3109,6 @@ bool NPC::AICheckCloseBeneficialSpells(
caster->GetCleanName()
);
if (mob->GetReverseFactionCon(caster) >= FACTION_KINDLY) {
continue;
}
if ((spell_types & SpellType_Buff) && !RuleB(NPC, BuffFriends)) {
if (mob != caster) {
spell_types = SpellType_Heal;