[8261] Skip not in world targets in same way as not existed targets.

This solve some crash possabilites after GetMap patch.
This commit is contained in:
VladimirMangos 2009-07-27 22:09:22 +04:00
parent 38326edb12
commit 8720687bdb
2 changed files with 8 additions and 8 deletions

View file

@ -43,7 +43,7 @@ template<class T>
void
TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
{
if( !i_target.isValid() || !&owner )
if (!i_target.isValid() || !i_target->IsInWorld())
return;
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
@ -126,10 +126,10 @@ template<class T>
bool
TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
{
if(!i_target.isValid())
if (!i_target.isValid() || !i_target->IsInWorld())
return false;
if( !&owner || !owner.isAlive())
if (!owner.isAlive())
return true;
if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED))

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8260"
#define REVISION_NR "8261"
#endif // __REVISION_NR_H__