Core/Spells: Set UNIT_FIELD_TARGET to current spell cast target for proper facing the target

This commit is contained in:
Shauren
2011-07-15 12:33:03 +02:00
parent 944fb4c1b7
commit 1e3c23a4e8
27 changed files with 125 additions and 96 deletions
@@ -85,7 +85,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
}
}
unit.SetUInt64Value(UNIT_FIELD_TARGET, 0);
unit.SetTarget(0);
unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.CastStop();
unit.StopMoving();
@@ -170,7 +170,7 @@ ConfusedMovementGenerator<T>::Finalize(T &unit)
unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
unit.ClearUnitState(UNIT_STAT_CONFUSED);
if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim())
unit.SetUInt64Value(UNIT_FIELD_TARGET, unit.getVictim()->GetGUID());
unit.SetTarget(unit.getVictim()->GetGUID());
}
template void ConfusedMovementGenerator<Player>::Initialize(Player &player);
@@ -304,7 +304,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
owner.CastStop();
owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.SetUInt64Value(UNIT_FIELD_TARGET, 0);
owner.SetTarget(0);
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
@@ -353,7 +353,7 @@ FleeingMovementGenerator<T>::Finalize(T &owner)
owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim())
owner.SetUInt64Value(UNIT_FIELD_TARGET, owner.getVictim()->GetGUID());
owner.SetTarget(owner.getVictim()->GetGUID());
}
template<class T>