AddControlEffect requires a luaspell be passed. On load of spell script data we remove the useless luaspell ptr.
This commit is contained in:
parent
555045cbe2
commit
e246609d34
@ -2725,7 +2725,7 @@ int EQ2Emu_lua_AddControlEffect(lua_State* state) {
|
||||
bool only_add_spawn = lua_interface->GetInt8Value(state, 3) == 1;
|
||||
LuaSpell* luaspell = lua_interface->GetCurrentSpell(state);
|
||||
|
||||
if(luaspell && luaspell->resisted) {
|
||||
if(!luaspell || luaspell->resisted) {
|
||||
lua_interface->ResetFunctionStack(state);
|
||||
return 0;
|
||||
}
|
||||
|
@ -4508,8 +4508,13 @@ int32 WorldDatabase::LoadSpellScriptData() {
|
||||
|
||||
while (result && (row = mysql_fetch_row(result))) {
|
||||
if (row[0] && strlen(row[0]) > 0) {
|
||||
if (lua_interface->GetSpell(row[0], false))
|
||||
LuaSpell* testSpell = nullptr;
|
||||
if ((testSpell = lua_interface->GetSpell(row[0], false)) != nullptr) {
|
||||
LogWrite(SPELL__DEBUG, 5, "Spells", "SpellScript: %s loaded.", row[0]);
|
||||
// make the lua_state available to the queue, this isn't a real Spell just a test load
|
||||
lua_interface->RemoveCurrentSpell(testSpell->state, testSpell);
|
||||
safe_delete(testSpell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user