aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-17 00:00:48 -0600
committermegamage <none@none>2009-01-17 00:00:48 -0600
commitf414ab1686c300787e3dfb0c397227062b8feea6 (patch)
tree2c76fa147dbf95b9192b01c7484d1804c03d2ed5 /src/game/Unit.cpp
parent0a1c601a1cc0e0036ad8fbfce68d87d14fa572d0 (diff)
*Update flee and confuse movement.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp36
1 files changed, 4 insertions, 32 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 370a94bd93f..be573338a66 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12857,13 +12857,6 @@ void Unit::SetFeared(bool apply)
{
if(apply)
{
- if(HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
- return;
-
- SetUInt64Value(UNIT_FIELD_TARGET, 0);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
- CastStop();
- //GetMotionMaster()->MovementExpired(false);
Unit *caster = NULL;
Unit::AuraList const& fearAuras = GetAurasByType(SPELL_AURA_MOD_FEAR);
if(!fearAuras.empty())
@@ -12872,17 +12865,8 @@ void Unit::SetFeared(bool apply)
}
else
{
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
- if(isAlive())
- {
- if( GetTypeId() != TYPEID_PLAYER && getVictim())
- {
- SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID());
- GetMotionMaster()->MoveChase(getVictim());
- }
- else
- GetMotionMaster()->Initialize();
- }
+ if(isAlive() && GetMotionMaster()->GetCurrentMovementGeneratorType() == FLEEING_MOTION_TYPE))
+ GetMotionMaster()->MovementExpired();
}
if (GetTypeId() == TYPEID_PLAYER)
@@ -12893,24 +12877,12 @@ void Unit::SetConfused(bool apply)
{
if(apply)
{
- SetUInt64Value(UNIT_FIELD_TARGET, 0);
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- CastStop();
GetMotionMaster()->MoveConfused();
}
else
{
- RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
- if(isAlive())
- {
- if( GetTypeId() != TYPEID_PLAYER && getVictim())
- {
- SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID());
- GetMotionMaster()->MoveChase(getVictim());
- }
- else
- GetMotionMaster()->Initialize();
- }
+ if(isAlive() && GetMotionMaster()->GetCurrentMovementGeneratorType() == CONFUSED_MOTION_TYPE)
+ GetMotionMaster()->MovementExpired();
}
if(GetTypeId() == TYPEID_PLAYER)