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

Port From (https://github.com/TrinityCore/TrinityCore/commit/a4fcfbb3afe388f90725734b0180ad8322277b7d)
This commit is contained in:
hondacrx
2021-12-01 23:05:27 -05:00
parent 694bda573b
commit 8fa7feb9da
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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; }
+2 -2
View File
@@ -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) { }
}
}
+4 -4
View File
@@ -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();