mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user