aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp36
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
2 files changed, 24 insertions, 16 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 95d9abe058c..04752e739d1 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -778,13 +778,17 @@ void Creature::Update(uint32 diff)
if (m_shouldReacquireTarget && !IsFocusing(nullptr, true))
{
SetTarget(m_suppressedTarget);
- if (!m_suppressedTarget.IsEmpty())
+
+ if (!HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
{
- if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
- SetFacingToObject(objTarget, false);
+ if (!m_suppressedTarget.IsEmpty())
+ {
+ if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
+ SetFacingToObject(objTarget, false);
+ }
+ else
+ SetFacingTo(m_suppressedOrientation, false);
}
- else
- SetFacingTo(m_suppressedOrientation, false);
m_shouldReacquireTarget = false;
}
@@ -3277,15 +3281,19 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
}
}
- bool const canTurnDuringCast = !spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST);
- // Face the target - we need to do this before the unit state is modified for no-turn spells
- if (target)
- SetFacingToObject(target, false);
- else if (!canTurnDuringCast)
- if (Unit* victim = GetVictim())
- SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast
+ bool const noTurnDuringCast = spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST);
+
+ if (!HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
+ {
+ // Face the target - we need to do this before the unit state is modified for no-turn spells
+ if (target)
+ SetFacingToObject(target, false);
+ else if (noTurnDuringCast)
+ if (Unit* victim = GetVictim())
+ SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast
+ }
- if (!canTurnDuringCast)
+ if (noTurnDuringCast)
AddUnitState(UNIT_STATE_CANNOT_TURN);
}
@@ -3323,7 +3331,7 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
if (focusSpell && focusSpell != m_focusSpell)
return;
- if (IsPet()) // player pets do not use delay system
+ if (IsPet() && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN)) // player pets do not use delay system
{
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Target), m_suppressedTarget);
if (!m_suppressedTarget.IsEmpty())
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2b37ec0d1c8..e933ea7b38c 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2021,7 +2021,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
return; // ignore ranged case
- if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
+ if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
// melee attack spell cast at main hand attack only - no normal melee dmg dealt
@@ -2105,7 +2105,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
return; // ignore ranged case
- if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
+ if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
CalcDamageInfo damageInfo;