mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[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:
parent
8e39ea0151
commit
8168b0f2eb
3 changed files with 4 additions and 15 deletions
|
|
@ -1093,7 +1093,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||||
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm... )
|
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm... )
|
||||||
if( !((Creature*)unit)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
|
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);
|
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... )
|
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm... )
|
||||||
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
|
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive() )
|
||||||
{
|
{
|
||||||
if ( Player* p = GetPlayerForCastQuestCond() )
|
if ( Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself() )
|
||||||
p->CastedCreatureOrGO(go->GetEntry(),go->GetGUID(),m_spellInfo->Id);
|
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... )
|
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm... )
|
||||||
if( !IsAutoRepeat() && !IsNextMeleeSwingSpell() )
|
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)
|
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -434,17 +434,6 @@ class Spell
|
||||||
|
|
||||||
CurrentSpellTypes GetCurrentContainer();
|
CurrentSpellTypes GetCurrentContainer();
|
||||||
|
|
||||||
Player* GetPlayerForCastQuestCond()
|
|
||||||
{
|
|
||||||
if ( m_caster->GetTypeId() == TYPEID_PLAYER )
|
|
||||||
return (Player*)m_caster;
|
|
||||||
|
|
||||||
if ( Unit* u = m_caster->GetCharmerOrOwner() )
|
|
||||||
if ( u->GetTypeId() == TYPEID_PLAYER )
|
|
||||||
return (Player*)u;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
Unit* GetCaster() const { return m_caster; }
|
Unit* GetCaster() const { return m_caster; }
|
||||||
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
Unit* GetOriginalCaster() const { return m_originalCaster; }
|
||||||
int32 GetPowerCost() const { return m_powerCost; }
|
int32 GetPowerCost() const { return m_powerCost; }
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7741"
|
#define REVISION_NR "7742"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue