Browse Source

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

Image 3 years ago
parent
commit
0e9c696de6
1 changed files with 10 additions and 0 deletions
  1. 10 0
      EQ2/source/WorldServer/WorldDatabase.cpp

+ 10 - 0
EQ2/source/WorldServer/WorldDatabase.cpp

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