Skip to content

Commit

Permalink
Implement SPELL_ATTR_EX5_DONT_TURN_DURING_CAST
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored and Cyberium committed Sep 13, 2016
1 parent ca0a00c commit 0a6ab9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/game/SharedDefines.h
Expand Up @@ -447,7 +447,7 @@ enum SpellAttributesEx5
SPELL_ATTR_EX5_UNK16 = 0x00010000,// 16
SPELL_ATTR_EX5_USABLE_WHILE_FEARED = 0x00020000,// 17 usable while feared
SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED = 0x00040000,// 18 usable while confused
SPELL_ATTR_EX5_UNK19 = 0x00080000,// 19
SPELL_ATTR_EX5_DONT_TURN_DURING_CAST = 0x00080000,// 19
SPELL_ATTR_EX5_UNK20 = 0x00100000,// 20
SPELL_ATTR_EX5_UNK21 = 0x00200000,// 21
SPELL_ATTR_EX5_UNK22 = 0x00400000,// 22
Expand Down
8 changes: 6 additions & 2 deletions src/game/Spell.cpp
Expand Up @@ -3192,8 +3192,12 @@ void Spell::cast(bool skipCheck)
return;
}

if (m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)
m_caster->SetInFront(m_targets.getUnitTarget());
if (m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster && !m_spellInfo->HasAttribute(SPELL_ATTR_EX5_DONT_TURN_DURING_CAST))
{
Unit* charmer = m_caster->GetCharmer();
if (charmer && !(charmer->GetTypeId() == TYPEID_PLAYER && ((Player*)charmer)->GetCamera().GetBody() == m_caster)) // need to check if target doesnt have a player controlling it
m_caster->SetInFront(m_targets.getUnitTarget());
}

SpellCastResult castResult = CheckPower();
if (castResult != SPELL_CAST_OK)
Expand Down

0 comments on commit 0a6ab9e

Please sign in to comment.