mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
bb2aca5217
commit
06b0e7a444
2 changed files with 5 additions and 3 deletions
|
|
@ -1089,9 +1089,11 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
|
||||||
break;
|
break;
|
||||||
case EVENT_T_RANGE:
|
case EVENT_T_RANGE:
|
||||||
if (Combat)
|
if (Combat)
|
||||||
if (m_creature->IsInMap(m_creature->getVictim()))
|
{
|
||||||
if (m_creature->IsInRange(m_creature->getVictim(),(float)(*i).Event.range.minDist,(float)(*i).Event.range.maxDist))
|
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);
|
ProcessEvent(*i);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8325"
|
#define REVISION_NR "8326"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue