Core/Spells: Fixed possible null pointer dereference
Coverity CID 1357406 (cherry picked from commit cc07a491f64fa958c8a27079bd2def84c577f816)
This commit is contained in:
1 parent
7ea03a2e47
commit
a778c8033f
1 file changed
+3
-1
@@ -11647,7 +11647,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
|
||||
return 0;
|
||||
if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
|
||||
return spellInfo->GetMaxRange();
|
||||
if (target == NULL)
|
||||
if (!target)
|
||||
return spellInfo->GetMaxRange(true);
|
||||
return spellInfo->GetMaxRange(!IsHostileTo(target));
|
||||
}
|
||||
@@ -11658,6 +11658,8 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
|
||||
return 0;
|
||||
if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
|
||||
return spellInfo->GetMinRange();
|
||||
if (!target)
|
||||
return spellInfo->GetMinRange(true);
|
||||
return spellInfo->GetMinRange(!IsHostileTo(target));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user