Merge remote-tracking branch 'origin/master' into 4.3.4

Conflicts:
	src/server/game/Entities/Unit/Unit.cpp
This commit is contained in:
Nay committed 2012-09-17 00:03:12 +01:00
commit e3add09fb7
14 files changed
+98 -62

No files matched your search

+31 -1
View File
@@ -266,7 +266,6 @@ Unit::Unit(bool isWorldObject): WorldObject(isWorldObject)
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
_focusSpell = NULL;
_targetLocked = false;
_lastLiquid = NULL;
_isWalkingBeforeCharm = false;
}
@@ -432,6 +431,9 @@ void Unit::UpdateSplinePosition()
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
}
if (HasUnitState(UNIT_STATE_CANNOT_TURN))
loc.orientation = GetOrientation();
UpdatePosition(loc.x, loc.y, loc.z, loc.orientation);
}
@@ -17133,3 +17135,31 @@ bool Unit::IsSplineEnabled() const
{
return movespline->Initialized();
}
void Unit::FocusTarget(Spell const* focusSpell, uint64 target)
{
// already focused
if (_focusSpell)
return;
_focusSpell = focusSpell;
SetUInt64Value(UNIT_FIELD_TARGET, target);
if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
AddUnitState(UNIT_STATE_ROTATING);
}
void Unit::ReleaseFocus(Spell const* focusSpell)
{
// focused to something else
if (focusSpell != _focusSpell)
return;
_focusSpell = NULL;
if (Unit* victim = getVictim())
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
else
SetUInt64Value(UNIT_FIELD_TARGET, 0);
if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
ClearUnitState(UNIT_STATE_ROTATING);
}