From 13eb5ab431b7ef94c22a07ac302339adf21403b3 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 17 Mar 2022 14:22:23 +0100 Subject: [PATCH] Check if the ESS singleton is null in spell's constructor. --- modules/entity_spell_system/data/spells/spell.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/entity_spell_system/data/spells/spell.cpp b/modules/entity_spell_system/data/spells/spell.cpp index 025566d9a..2143de9e5 100644 --- a/modules/entity_spell_system/data/spells/spell.cpp +++ b/modules/entity_spell_system/data/spells/spell.cpp @@ -1668,7 +1668,10 @@ Spell::Spell() { _level = 1; _rank = 0; - _scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); + + if (ESS::get_singleton()) { + _scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); + } _global_cooldown_enabled = true; _is_local_spell = false; @@ -1726,7 +1729,9 @@ Spell::Spell() { _aura_is_debuff = false; _aura_hide = false; - _aura_scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); + if (ESS::get_singleton()) { + _aura_scale_with_level = ESS::get_singleton()->get_scale_spells_by_default(); + } _aura_damage_enabled = false; _aura_damage_type = 0;