Some misc cleansup.

This commit is contained in:
hondacrx
2023-10-06 17:33:20 -04:00
parent 85f37f6edf
commit ccb5341c21
13 changed files with 30 additions and 42 deletions
+1 -1
View File
@@ -1696,7 +1696,7 @@ namespace Game.Spells
// check spell triggering us
Spell spell = eventInfo.GetProcSpell();
if (spell)
if (spell != null)
{
// Do not allow auras to proc from effect triggered from itself
if (spell.IsTriggeredByAura(m_spellInfo))
+3 -3
View File
@@ -637,7 +637,7 @@ namespace Game.Spells
break;
case AuraType.ModCastingSpeedNotStack:
// skip melee hits and instant cast spells
if (!eventInfo.GetProcSpell() || eventInfo.GetProcSpell().GetCastTime() == 0)
if (eventInfo.GetProcSpell() == null || eventInfo.GetProcSpell().GetCastTime() == 0)
return false;
break;
case AuraType.ModSchoolMaskDamageFromCaster:
@@ -651,7 +651,7 @@ namespace Game.Spells
{
// Skip melee hits and spells with wrong school or zero cost
if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()) // School Check
|| !eventInfo.GetProcSpell())
|| eventInfo.GetProcSpell() == null)
return false;
// Costs Check
@@ -1963,7 +1963,7 @@ namespace Game.Spells
for (var i = CurrentSpellTypes.Melee; i < CurrentSpellTypes.Max; ++i)
{
Spell spell = target.GetCurrentSpell(i);
if (spell)
if (spell != null)
if (spell.m_spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.NoActions))
// Stop spells on prepare or casting state
target.InterruptSpell(i, false);
+3 -8
View File
@@ -106,7 +106,7 @@ namespace Game.Spells
for (var i = 0; i < m_loadedScripts.Count; ++i)
m_loadedScripts[i]._Unload();
if (m_referencedFromCurrentSpell && m_selfContainer && m_selfContainer == this)
if (m_referencedFromCurrentSpell && m_selfContainer != null && m_selfContainer == this)
{
// Clean the reference to avoid later crash.
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
@@ -2722,13 +2722,13 @@ namespace Game.Spells
if (modOwner)
{
lastSpellMod = modOwner.m_spellModTakingSpell;
if (lastSpellMod)
if (lastSpellMod != null)
modOwner.SetSpellModTakingSpell(lastSpellMod, false);
}
_cast(skipCheck);
if (lastSpellMod)
if (lastSpellMod != null)
modOwner.SetSpellModTakingSpell(lastSpellMod, true);
}
@@ -8086,11 +8086,6 @@ namespace Game.Spells
public int GetTimer() { return m_timer; }
public static implicit operator bool(Spell spell)
{
return spell != null;
}
#region Fields
Dictionary<SpellEffectName, SpellLogEffect> _executeLogEffects = new();
PathGenerator m_preGeneratedPath;
+1 -1
View File
@@ -468,7 +468,7 @@ namespace Game.Entities
// check power requirement
if (procEntry.AttributesMask.HasAnyFlag(ProcAttributes.ReqPowerCost))
{
if (!eventInfo.GetProcSpell())
if (eventInfo.GetProcSpell() == null)
return false;
var costs = eventInfo.GetProcSpell().GetPowerCost();