min_range field

This commit is contained in:
KayenEQ
2014-08-03 16:04:55 -04:00
parent ef982b9ce2
commit f3710856ad
7 changed files with 23 additions and 11 deletions
+2 -1
View File
@@ -567,6 +567,7 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
//So keep a list of entity ids and look up after
std::list<uint32> id_list;
range = range * range;
float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range;
float dist_targ = 0;
auto iterator = list.begin();
while (iterator != list.end())
@@ -575,7 +576,7 @@ void HateList::SpellCast(Mob *caster, uint32 spell_id, float range)
if(range > 0)
{
dist_targ = caster->DistNoRoot(*h->ent);
if(dist_targ <= range)
if(dist_targ <= range && dist_targ >= min_range2)
{
id_list.push_back(h->ent->GetID());
h->ent->CalcSpellPowerDistanceMod(spell_id, dist_targ);