Core/Scripts: Rename recent GameObject spell overloads to fix GCC warnings

Rename recent GameObject spell overloads (they used to accept only Unit as parameters) to fix GCC warnings about partial function override.

(cherry picked from commit e3a9a9bfb2)
This commit is contained in:
jackpoz
2019-04-27 23:38:48 +02:00
committed by Shauren
parent c73fd0e6e3
commit a4fcfbb3af
3 changed files with 8 additions and 8 deletions

View File

@@ -97,11 +97,11 @@ class TC_GAME_API GameObjectAI
// Called when hit by a spell
virtual void SpellHit(Unit* /*caster*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHit(GameObject* /*caster*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitByGameObject(GameObject* /*caster*/, SpellInfo const* /*spellInfo*/) { }
// Called when spell hits a target
virtual void SpellHitTarget(Unit* /*target*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitTarget(GameObject* /*target*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitTargetGameObject(GameObject* /*target*/, SpellInfo const* /*spellInfo*/) { }
};
class TC_GAME_API NullGameObjectAI : public GameObjectAI

View File

@@ -117,11 +117,11 @@ class TC_GAME_API CreatureAI : public UnitAI
// Called when hit by a spell
virtual void SpellHit(Unit* /*caster*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHit(GameObject* /*caster*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitByGameObject(GameObject* /*caster*/, SpellInfo const* /*spellInfo*/) { }
// Called when spell hits a target
virtual void SpellHitTarget(Unit* /*target*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitTarget(GameObject* /*target*/, SpellInfo const* /*spellInfo*/) { }
virtual void SpellHitTargetGameObject(GameObject* /*target*/, SpellInfo const* /*spellInfo*/) { }
virtual bool IsEscorted() const { return false; }

View File

@@ -2638,7 +2638,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
if (CreatureAI* hitTargetAI = cHitTarget->AI())
{
if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT)
hitTargetAI->SpellHit(spell->m_caster->ToGameObject(), spell->m_spellInfo);
hitTargetAI->SpellHitByGameObject(spell->m_caster->ToGameObject(), spell->m_spellInfo);
else
hitTargetAI->SpellHit(spell->m_caster->ToUnit(), spell->m_spellInfo);
}
@@ -2689,15 +2689,15 @@ void Spell::GOTargetInfo::DoTargetSpellHit(Spell* spell, SpellEffectInfo const&
if (go->AI())
{
if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT)
go->AI()->SpellHit(spell->m_caster->ToGameObject(), spell->m_spellInfo);
go->AI()->SpellHitByGameObject(spell->m_caster->ToGameObject(), spell->m_spellInfo);
else
go->AI()->SpellHit(spell->m_caster->ToUnit(), spell->m_spellInfo);
}
if (spell->m_caster->GetTypeId() == TYPEID_UNIT && spell->m_caster->ToCreature()->IsAIEnabled())
spell->m_caster->ToCreature()->AI()->SpellHitTarget(go, spell->m_spellInfo);
spell->m_caster->ToCreature()->AI()->SpellHitTargetGameObject(go, spell->m_spellInfo);
else if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT && spell->m_caster->ToGameObject()->AI())
spell->m_caster->ToGameObject()->AI()->SpellHitTarget(go, spell->m_spellInfo);
spell->m_caster->ToGameObject()->AI()->SpellHitTargetGameObject(go, spell->m_spellInfo);
spell->CallScriptOnHitHandlers();
spell->CallScriptAfterHitHandlers();