Manual merge of TargetRing pull request #286.

This commit is contained in:
JJ
2014-11-10 10:00:53 -05:00
parent 384d8c6167
commit d5efa0f23c
11 changed files with 59 additions and 6 deletions
+10 -2
View File
@@ -765,7 +765,13 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if (curmob == caster && !affect_caster) //watch for caster too
continue;
dist_targ = center->DistNoRoot(*curmob);
if (spells[spell_id].targettype == ST_Ring) {
dist_targ = curmob->DistNoRoot(caster->GetTargetRingX(), caster->GetTargetRingY(), caster->GetTargetRingZ());
}
else if (center) {
dist_targ = center->DistNoRoot(*curmob);
}
if (dist_targ > dist2) //make sure they are in range
continue;
if (dist_targ < min_range2) //make sure they are in range
@@ -787,7 +793,9 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if (bad) {
if (!caster->IsAttackAllowed(curmob, true))
continue;
if (!center->CheckLosFN(curmob))
if (center && !center->CheckLosFN(curmob))
continue;
if (!center && !caster->CheckLosFN(caster->GetTargetRingX(), caster->GetTargetRingY(), caster->GetTargetRingZ(), curmob->GetSize()))
continue;
} else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// This does not check faction for beneficial AE buffs..only agro and attackable.