Browse Source

if spell state is null don't process spell

Fix #226 - should mitigate at the very least, help us identify why this is happening
Image 4 years ago
parent
commit
287307c397
1 changed files with 5 additions and 1 deletions
  1. 5 1
      EQ2/source/WorldServer/SpellProcess.cpp

+ 5 - 1
EQ2/source/WorldServer/SpellProcess.cpp

@@ -429,7 +429,11 @@ bool SpellProcess::DeleteCasterSpell(LuaSpell* spell, string reason){
 
 bool SpellProcess::ProcessSpell(LuaSpell* spell, bool first_cast, const char* function, SpellScriptTimer* timer) {
 	bool ret = false;
-	if(lua_interface && !spell->interrupted){
+	if(!spell->state)
+	{
+		LogWrite(SPELL__ERROR, 0, "Spell", "Error: State is NULL!  SpellProcess::ProcessSpell for Spell '%s'", (spell->spell != nullptr) ? spell->spell->GetName() : "Unknown");
+	}
+	else if(lua_interface && !spell->interrupted){
 		lua_interface->AddSpawnPointers(spell, first_cast, false, function, timer);
 		vector<LUAData*>* data = spell->spell->GetLUAData();
 		for(int32 i=0;i<data->size();i++){