*Prevent MoveFollow and MoveChase while UNIT_FLAG_DISABLE_MOVE is present, by Liberate. Closes #168.

*Some cleanup, and fix typo from cf0046bc32c6.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-19 20:03:35 -08:00
parent f4808f3ff5
commit 72607c20ba
2 changed files with 33 additions and 32 deletions
+4 -3
View File
@@ -138,7 +138,8 @@ MotionMaster::DelayedClean()
{
MovementGenerator *curr = top();
pop();
if(curr) DelayedDelete(curr);
if (curr)
DelayedDelete(curr);
}
}
@@ -234,7 +235,7 @@ void
MotionMaster::MoveChase(Unit* target, float dist, float angle)
{
// ignore movement request if target not exist
if(!target || target == i_owner)
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
return;
i_owner->clearUnitState(UNIT_STAT_FOLLOW);
@@ -260,7 +261,7 @@ void
MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
{
// ignore movement request if target not exist
if(!target || target == i_owner)
if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
return;
i_owner->addUnitState(UNIT_STAT_FOLLOW);
+1 -1
View File
@@ -5255,7 +5255,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
case 45151:
{
//Workaround for Range ... should be global for every ScriptEffect
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->GetDistance(m_caster) >= radius && !unitTarget->HasAura(46394) && unitTarget != m_caster)
unitTarget->CastSpell(unitTarget, 46394, true);