[7742] Fix my prev. commit

Use already defined method for getting charmer or owner player or player itself.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-05-02 00:26:42 +02:00
parent 8e39ea0151
commit 8168b0f2eb
3 changed files with 4 additions and 15 deletions

View file

@ -1093,7 +1093,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm... )
if( !((Creature*)unit)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
{
if ( Player* p = GetPlayerForCastQuestCond() )
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
p->CastedCreatureOrGO(unit->GetEntry(),unit->GetGUID(),m_spellInfo->Id);
}
@ -1242,7 +1242,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm... )
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
{
if ( Player* p = GetPlayerForCastQuestCond() )
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
p->CastedCreatureOrGO(go->GetEntry(),go->GetGUID(),m_spellInfo->Id);
}
}
@ -2699,7 +2699,7 @@ void Spell::update(uint32 difftime)
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm... )
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() )
{
if ( Player* p = GetPlayerForCastQuestCond() )
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
{
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
{