[8181] Prevent passing negative values into IsWithinDist() in stealth detection

* This should fix wrong stealth detection for high level differencies

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-14 19:27:40 +02:00
parent 58a292e99c
commit fcb34b3928
2 changed files with 2 additions and 2 deletions

View file

@ -9259,7 +9259,7 @@ bool Unit::isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList,
//based on wowwiki every 5 mod we have 1 more level diff in calculation
visibleDistance += (int32(u->GetTotalAuraModifier(SPELL_AURA_MOD_DETECT)) - stealthMod)/5.0f;
if(!IsWithinDist(u,visibleDistance))
if(visibleDistance <= 0 || !IsWithinDist(u,visibleDistance))
return false;
}