Skip to content

Commit

Permalink
Fixed channeled spells visual effect(Like in Arcane missles). See htt…
Browse files Browse the repository at this point in the history
  • Loading branch information
Den Tom committed Apr 22, 2011
1 parent 411b069 commit b5af463
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ void Aura::TriggerSpell()
{
ObjectGuid casterGUID = GetCasterGuid();
Unit* triggerTarget = GetTriggerTarget();
Unit* caster = GetCaster();

if (casterGUID.IsEmpty() || !triggerTarget)
return;
Expand Down Expand Up @@ -1149,7 +1150,6 @@ void Aura::TriggerSpell()
// case 30401: break;
case 30427: // Extract Gas
{
Unit* caster = GetCaster();
if (!caster)
return;
// move loot to player inventory and despawn target
Expand Down Expand Up @@ -1311,10 +1311,10 @@ void Aura::TriggerSpell()
if (target->GetTypeId() != TYPEID_UNIT)
return;

if (Unit* caster = GetCaster())
caster->CastSpell(caster, 38495, true, NULL, this);
else
if (!caster)
return;

caster->CastSpell(caster, 38495, true, NULL, this);

Creature* creatureTarget = (Creature*)target;

Expand Down Expand Up @@ -1611,7 +1611,7 @@ void Aura::TriggerSpell()
return;
case 38736: // Rod of Purification - for quest 10839 (Veil Skith: Darkstone of Terokk)
{
if (Unit* caster = GetCaster())
if (caster)
caster->CastSpell(triggerTarget, trigger_spell_id, true, NULL, this);
return;
}
Expand All @@ -1620,10 +1620,16 @@ void Aura::TriggerSpell()

// All ok cast by default case
if (triggeredSpellInfo)
triggerTarget->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this, casterGUID);
if (!caster)
// maybe caster must be triggerTarget, if caster is NULL
// if (!caster)
// caster = triggerTarget;
sLog.outError("Aura::TriggerSpell: Spell %u have no caster(GetCaster returns NULL) at aura effect %u. Perhaps, caster must be same as triggerTarget.",GetId(),GetEffIndex());
else
caster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this, casterGUID);
else
{
if (Unit* caster = GetCaster())
if (caster)
{
if (triggerTarget->GetTypeId() != TYPEID_UNIT || !sScriptMgr.OnEffectDummy(caster, GetId(), GetEffIndex(), (Creature*)triggerTarget))
sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
Expand Down

2 comments on commit b5af463

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit* caster = GetCaster(); _specially done in ti case where it required for performence.

getCaster is query object by guid in globale/map local tables. Not need do it when it not need really.

also rejected. because in most cases triggered target must be target of aura, and ofc not caster

@Lillecarl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for asking, but why don't you create patches and get them into the real mangos repository, else there is so much work being wasted :/

Please sign in to comment.