Skip to content

Commit

Permalink
[s0011] Skip not in world targets in same way as not existed targets.
Browse files Browse the repository at this point in the history
This solve some crash possabilites after GetMap patch.

(based on commit c60ab8e)
  • Loading branch information
VladimirMangos committed Jul 14, 2010
1 parent 3b5527a commit d40de67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/game/TargetedMovementGenerator.cpp
Expand Up @@ -31,7 +31,7 @@
template<class T, typename D>
void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
{
if (!i_target.isValid() || !&owner)
if (!i_target.isValid() || !i_target->IsInWorld())
return;

if (owner.hasUnitState(UNIT_STAT_NOT_MOVE))
Expand Down Expand Up @@ -111,10 +111,10 @@ void TargetedMovementGeneratorMedium<Creature,FollowMovementGenerator<Creature>
template<class T, typename D>
bool TargetedMovementGeneratorMedium<T,D>::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_NOT_MOVE))
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "0010"
#define REVISION_NR "0011"
#endif // __REVISION_NR_H__

0 comments on commit d40de67

Please sign in to comment.