Explorar el Código

avoid crash when GetZone is not set for spell caster

Emagi hace 1 año
padre
commit
e2b8770ac3
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      EQ2/source/WorldServer/LuaInterface.cpp

+ 2 - 1
EQ2/source/WorldServer/LuaInterface.cpp

@@ -819,8 +819,9 @@ void LuaInterface::RemoveSpell(LuaSpell* spell, bool call_remove_function, bool
 			spawn_wrapper = new LUASpawnWrapper();
 			if(!spell->initial_target)
 				spawn_wrapper->spawn = spell->caster->GetTarget();
-			else
+			else if(spell->caster->GetZone()) {
 				spawn_wrapper->spawn = spell->caster->GetZone()->GetSpawnByID(spell->initial_target);
+			}
 			AddUserDataPtr(spawn_wrapper, spawn_wrapper->spawn);
 			lua_pushlightuserdata(spell->state, spawn_wrapper);
 		}