aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorjoschiwald <joschiwald@online.de>2013-08-18 01:41:10 +0200
committerjoschiwald <joschiwald@online.de>2013-08-18 01:41:10 +0200
commit2b19ba1879cbdb121abe99f8d1060628a0c7243f (patch)
treee50c7a58d55ea5e5caa6469d80aa2f8569e94fab /src/server/scripts/Spells
parentc32dbd1432b28206fee430da7e9f77d6053730fc (diff)
Misc: replace Unit::GetPlayer with ObjectAccessor::GetPlayer and some cosmetic changes
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 8c0864e76b9..b1152c311dc 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -743,15 +743,10 @@ class spell_hun_sniper_training : public SpellScriptLoader
PreventDefaultAction();
if (aurEff->GetAmount() <= 0)
{
- Unit* caster = GetCaster();
+ Unit* target = GetTarget();
uint32 spellId = SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 + GetId() - SPELL_HUNTER_SNIPER_TRAINING_R1;
- if (Unit* target = GetTarget())
- if (!target->HasAura(spellId))
- {
- SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(spellId);
- Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster() ? caster : target;
- triggerCaster->CastSpell(target, triggeredSpellInfo, true, 0, aurEff);
- }
+ if (!target->HasAura(spellId))
+ target->CastSpell(target, spellId, true, 0, aurEff);
}
}