[8326] Check getVictim() before IsInMap check in EventAI EVENT_T_RANGE and prevent possible crash.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2009-08-06 20:50:13 +02:00
parent bb2aca5217
commit 06b0e7a444
2 changed files with 5 additions and 3 deletions

View file

@ -1089,9 +1089,11 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
break;
case EVENT_T_RANGE:
if (Combat)
if (m_creature->IsInMap(m_creature->getVictim()))
{
if (m_creature->getVictim() && m_creature->IsInMap(m_creature->getVictim()))
if (m_creature->IsInRange(m_creature->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist))
ProcessEvent(*i);
}
break;
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8325"
#define REVISION_NR "8326"
#endif // __REVISION_NR_H__