mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/Spells: Fixed possible null pointer dereference
Coverity CID 1357406
This commit is contained in:
@@ -10711,7 +10711,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));
|
||||
}
|
||||
@@ -10722,6 +10722,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