From 8fa7feb9da57ba2613ec853ad617be176b4a9580 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 1 Dec 2021 23:05:27 -0500 Subject: [PATCH] Core/Scripts: Rename recent GameObject spell overloads to fix warnings Port From (https://github.com/TrinityCore/TrinityCore/commit/a4fcfbb3afe388f90725734b0180ad8322277b7d) --- Source/Game/AI/CoreAI/CreatureAI.cs | 4 ++-- Source/Game/AI/CoreAI/GameObjectAI.cs | 4 ++-- Source/Game/Spells/Spell.cs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Game/AI/CoreAI/CreatureAI.cs b/Source/Game/AI/CoreAI/CreatureAI.cs index ca96923c6..60c17d351 100644 --- a/Source/Game/AI/CoreAI/CreatureAI.cs +++ b/Source/Game/AI/CoreAI/CreatureAI.cs @@ -388,11 +388,11 @@ namespace Game.AI // Called when hit by a spell public virtual void SpellHit(Unit caster, SpellInfo spellInfo) { } - public virtual void SpellHit(GameObject caster, SpellInfo spellInfo) { } + public virtual void SpellHitByGameObject(GameObject caster, SpellInfo spellInfo) { } // Called when spell hits a target public virtual void SpellHitTarget(Unit target, SpellInfo spellInfo) { } - public virtual void SpellHitTarget(GameObject target, SpellInfo spellInfo) { } + public virtual void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo) { } public virtual bool IsEscorted() { return false; } diff --git a/Source/Game/AI/CoreAI/GameObjectAI.cs b/Source/Game/AI/CoreAI/GameObjectAI.cs index 4d8f644cb..5affad8e2 100644 --- a/Source/Game/AI/CoreAI/GameObjectAI.cs +++ b/Source/Game/AI/CoreAI/GameObjectAI.cs @@ -96,10 +96,10 @@ namespace Game.AI // Called when hit by a spell public virtual void SpellHit(Unit caster, SpellInfo spellInfo) { } - public virtual void SpellHit(GameObject caster, SpellInfo spellInfo) { } + public virtual void SpellHitByGameObject(GameObject caster, SpellInfo spellInfo) { } // Called when spell hits a target public virtual void SpellHitTarget(Unit target, SpellInfo spellInfo) { } - public virtual void SpellHitTarget(GameObject target, SpellInfo spellInfo) { } + public virtual void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo) { } } } diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 69f770453..9c7ab8f5a 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -8029,7 +8029,7 @@ namespace Game.Spells if (hitTargetAI != null) { if (spell.GetCaster().IsGameObject()) - hitTargetAI.SpellHit(spell.GetCaster().ToGameObject(), spell.m_spellInfo); + hitTargetAI.SpellHitByGameObject(spell.GetCaster().ToGameObject(), spell.m_spellInfo); else hitTargetAI.SpellHit(spell.GetCaster().ToUnit(), spell.m_spellInfo); } @@ -8088,15 +8088,15 @@ namespace Game.Spells if (go.GetAI() != null) { if (spell.GetCaster().IsGameObject()) - go.GetAI().SpellHit(spell.GetCaster().ToGameObject(), spell.m_spellInfo); + go.GetAI().SpellHitByGameObject(spell.GetCaster().ToGameObject(), spell.m_spellInfo); else go.GetAI().SpellHit(spell.GetCaster().ToUnit(), spell.m_spellInfo); } if (spell.GetCaster().IsCreature() && spell.GetCaster().ToCreature().IsAIEnabled()) - spell.GetCaster().ToCreature().GetAI().SpellHitTarget(go, spell.m_spellInfo); + spell.GetCaster().ToCreature().GetAI().SpellHitTargetGameObject(go, spell.m_spellInfo); else if (spell.GetCaster().IsGameObject() && spell.GetCaster().ToGameObject().GetAI() != null) - spell.GetCaster().ToGameObject().GetAI().SpellHitTarget(go, spell.m_spellInfo); + spell.GetCaster().ToGameObject().GetAI().SpellHitTargetGameObject(go, spell.m_spellInfo); spell.CallScriptOnHitHandlers(); spell.CallScriptAfterHitHandlers();