1
0

address spell state not getting reset if call process failed to trigger

This commit is contained in:
Emagi 2024-09-25 07:35:27 -04:00
parent 48ee02ea90
commit 8ac01db525

View File

@ -560,8 +560,10 @@ bool SpellProcess::ProcessSpell(LuaSpell* spell, bool first_cast, const char* fu
if(altSpawn) if(altSpawn)
{ {
std::string functionCall = ApplyLuaFunction(spell, first_cast, function, timer, altSpawn); std::string functionCall = ApplyLuaFunction(spell, first_cast, function, timer, altSpawn);
if(functionCall.length() < 1) if(functionCall.length() < 1) {
ret = false; ret = false;
lua_interface->ResetFunctionStack(spell->state);
}
else else
ret = lua_interface->CallSpellProcess(spell, 2 + spell->spell->GetLUAData()->size(), functionCall); ret = lua_interface->CallSpellProcess(spell, 2 + spell->spell->GetLUAData()->size(), functionCall);
} }
@ -570,8 +572,10 @@ bool SpellProcess::ProcessSpell(LuaSpell* spell, bool first_cast, const char* fu
return true; return true;
} }
std::string functionCall = ApplyLuaFunction(spell, first_cast, function, timer); std::string functionCall = ApplyLuaFunction(spell, first_cast, function, timer);
if(functionCall.length() < 1) if(functionCall.length() < 1) {
ret = false; ret = false;
lua_interface->ResetFunctionStack(spell->state);
}
else else
ret = lua_interface->CallSpellProcess(spell, 2 + spell->spell->GetLUAData()->size(), functionCall); ret = lua_interface->CallSpellProcess(spell, 2 + spell->spell->GetLUAData()->size(), functionCall);
} }