aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-30 12:32:48 +0200
committerQAston <none@none>2009-07-30 12:32:48 +0200
commitd78327395547eddede45fd02b16aeaab1ae89241 (patch)
treeb8d096122f88277148f8ae8ccf900fc2722c98c1
parent98a80ff5185be4bdc2d3a336ebd7756b1f264f1d (diff)
*[8261] Skip not in world targets in same way as not existed targets (note: this is a hack and needs better sollution) Author: VladimirMangos.
--HG-- branch : trunk
-rw-r--r--src/game/TargetedMovementGenerator.cpp4
-rw-r--r--src/game/Unit.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp
index c40568318d4..c1c601921b3 100644
--- a/src/game/TargetedMovementGenerator.cpp
+++ b/src/game/TargetedMovementGenerator.cpp
@@ -53,7 +53,7 @@ template<class T>
bool
TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
{
- if( !i_target.isValid() || !&owner )
+ if (!i_target.isValid() || !i_target->IsInWorld())
return false;
if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) )
@@ -170,7 +170,7 @@ 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())
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3656e5096f3..8002a5cf078 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12198,7 +12198,6 @@ void Unit::RemoveFromWorld()
ExitVehicle();
UnsummonAllTotems();
RemoveAllControlled();
- GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
if(m_NotifyListPos >= 0)
{
@@ -12231,6 +12230,7 @@ void Unit::CleanupsBeforeDelete()
getHostilRefManager().setOnlineOfflineState(false);
RemoveAllGameObjects();
RemoveAllDynObjects();
+ GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
if(IsInWorld())
RemoveFromWorld();