From d78327395547eddede45fd02b16aeaab1ae89241 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 30 Jul 2009 12:32:48 +0200 Subject: *[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 --- src/game/TargetedMovementGenerator.cpp | 4 ++-- src/game/Unit.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 bool TargetedMovementGenerator::_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 bool TargetedMovementGenerator::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(); -- cgit v1.2.3