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
+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;