*[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
This commit is contained in:
@@ -53,7 +53,7 @@ template<class T>
|
|||||||
bool
|
bool
|
||||||
TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||||
{
|
{
|
||||||
if( !i_target.isValid() || !&owner )
|
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) )
|
if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) )
|
||||||
@@ -170,7 +170,7 @@ template<class T>
|
|||||||
bool
|
bool
|
||||||
TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
|
||||||
{
|
{
|
||||||
if(!i_target.isValid())
|
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !&owner || !owner.isAlive())
|
if( !&owner || !owner.isAlive())
|
||||||
|
|||||||
+1
-1
@@ -12198,7 +12198,6 @@ void Unit::RemoveFromWorld()
|
|||||||
ExitVehicle();
|
ExitVehicle();
|
||||||
UnsummonAllTotems();
|
UnsummonAllTotems();
|
||||||
RemoveAllControlled();
|
RemoveAllControlled();
|
||||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
|
||||||
|
|
||||||
if(m_NotifyListPos >= 0)
|
if(m_NotifyListPos >= 0)
|
||||||
{
|
{
|
||||||
@@ -12231,6 +12230,7 @@ void Unit::CleanupsBeforeDelete()
|
|||||||
getHostilRefManager().setOnlineOfflineState(false);
|
getHostilRefManager().setOnlineOfflineState(false);
|
||||||
RemoveAllGameObjects();
|
RemoveAllGameObjects();
|
||||||
RemoveAllDynObjects();
|
RemoveAllDynObjects();
|
||||||
|
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||||
|
|
||||||
if(IsInWorld())
|
if(IsInWorld())
|
||||||
RemoveFromWorld();
|
RemoveFromWorld();
|
||||||
|
|||||||
Reference in New Issue
Block a user