Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
commit
fca4a5448a
166 files changed
+3523
-3008
No files matched your search
@@ -645,7 +645,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
if (Player* playerCaster = m_caster->ToPlayer())
|
||||
{
|
||||
// selection has to be found and to be valid target for the spell
|
||||
if (Unit* selectedUnit = ObjectAccessor::GetUnit(*m_caster, playerCaster->GetSelection()))
|
||||
if (Unit* selectedUnit = ObjectAccessor::GetUnit(*m_caster, playerCaster->GetTarget()))
|
||||
if (m_spellInfo->CheckExplicitTarget(m_caster, selectedUnit) == SPELL_CAST_OK)
|
||||
unit = selectedUnit;
|
||||
}
|
||||
@@ -1764,9 +1764,9 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
|
||||
{
|
||||
case SPELL_EFFECT_SUMMON_RAF_FRIEND:
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection())
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->GetTarget())
|
||||
{
|
||||
WorldObject* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
WorldObject* target = ObjectAccessor::FindPlayer(m_caster->GetTarget());
|
||||
|
||||
CallScriptObjectTargetSelectHandlers(target, SpellEffIndex(effIndex));
|
||||
|
||||
@@ -3094,7 +3094,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
|
||||
// set target for proper facing
|
||||
if ((m_casttime || m_spellInfo->IsChanneled()) && !(_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING))
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
|
||||
m_caster->FocusTarget(this, m_targets.GetObjectTarget());
|
||||
m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_GCD))
|
||||
TriggerGlobalCooldown();
|
||||
@@ -3665,8 +3665,8 @@ void Spell::finish(bool ok)
|
||||
((Puppet*)charm)->UnSummon();
|
||||
}
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT)
|
||||
m_caster->ReleaseFocus(this);
|
||||
if (Creature* creatureCaster = m_caster->ToCreature())
|
||||
creatureCaster->ReleaseFocus(this);
|
||||
|
||||
if (!ok)
|
||||
return;
|
||||
@@ -5376,10 +5376,10 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
if (!m_caster->ToPlayer()->GetSelection())
|
||||
if (!m_caster->GetTarget())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetSelection());
|
||||
Player* target = ObjectAccessor::FindPlayer(m_caster->ToPlayer()->GetTarget());
|
||||
if (!target || m_caster->ToPlayer() == target || (!target->IsInSameRaidWith(m_caster->ToPlayer()) && m_spellInfo->Id != 48955)) // refer-a-friend spell
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
@@ -5411,10 +5411,10 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
Player* playerCaster = m_caster->ToPlayer();
|
||||
//
|
||||
if (!(playerCaster->GetSelection()))
|
||||
if (!(playerCaster->GetTarget()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Player* target = ObjectAccessor::FindPlayer(playerCaster->GetSelection());
|
||||
Player* target = playerCaster->GetSelectedPlayer();
|
||||
|
||||
if (!target ||
|
||||
!(target->GetSession()->GetRecruiterId() == playerCaster->GetSession()->GetAccountId() || target->GetSession()->GetAccountId() == playerCaster->GetSession()->GetRecruiterId()))
|
||||
|
||||
Reference in new issue
Block a user