diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index f33cbcfd6..9ec7ece76 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -43,18 +43,18 @@ template void TargetedMovementGenerator::_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) ) + if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) return; // prevent redundant micro-movement for pets, other followers. - if(i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) + if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) return; float x, y, z; - if(!i_offset) + if (!i_offset) { // to nearest contact position i_target->GetContactPoint( &owner, x, y, z ); @@ -126,13 +126,13 @@ 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()) + if (!owner.isAlive()) return true; - if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED) ) + if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED)) return true; // prevent movement while casting spells with cast time or channel time diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b8ec233b8..6e44f933f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8260" + #define REVISION_NR "8261" #endif // __REVISION_NR_H__