spell crash fix when spell can't be found (happened on drink but we dont know what spell)

This commit is contained in:
Image 2021-04-08 08:20:45 -04:00
parent fe260f507b
commit 0e9c696de6

View file

@ -7416,6 +7416,16 @@ void WorldDatabase::LoadCharacterSpellEffects(int32 char_id, Client* client, int
Spell* spell = master_spell_list.GetSpell(spell_id, tier);
if(!spell)
{
LogWrite(LUA__ERROR, 0, "LUA", "WorldDatabase::LoadCharacterSpellEffects: GetSpell(%u, %u), spell could not be found!", spell_id, tier);
Spell* spell = master_spell_list.GetSpell(spell_id, 0);
if(spell)
LogWrite(LUA__WARNING, 0, "LUA", "WorldDatabase::LoadCharacterSpellEffects: GetSpell(%u, %u), identified tier 0 as replacement since the GetSpell failed!", spell_id, tier);
else
continue;
}
bool isMaintained = false;
bool isExistingLuaSpell = false;
MaintainedEffects* effect = nullptr;