[Bug Fix] Alleviate some lag with crosszone/worldwide spell casting. (#2016)

- Spell casting was using SpellFinished which casts the spell, and if the spell was a group spell each member of the group would cast it on all the other members, causing a chain reaction.
- This fix utilizes ApplySpellBuff(spell_id, duration) so that it only casts the spell on the target, as with the crosszone and worldwide methods you will be affecting your target based on identifiers regardless.
- This should alleviate some of the crosszone/worldwide casting crashes on larger servers such as Lazarus.
This commit is contained in:
Kinglykrab
2022-02-20 21:59:46 -05:00
committed by GitHub
parent 70eed67e08
commit d86544ff60
3 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -2450,7 +2450,7 @@ void Lua_Mob::SetSeeInvisibleUndeadLevel(uint8 invisible_level)
void Lua_Mob::ApplySpellBuff(int spell_id) {
Lua_Safe_Call_Void();
self->ApplySpellBuff(spell_id, 0);
self->ApplySpellBuff(spell_id);
}
void Lua_Mob::ApplySpellBuff(int spell_id, int duration) {
@@ -2470,7 +2470,7 @@ int Lua_Mob::GetBuffStatValueBySpell(int spell_id, const char* identifier) {
void Lua_Mob::SetBuffDuration(int spell_id) {
Lua_Safe_Call_Void();
self->SetBuffDuration(spell_id, 0);
self->SetBuffDuration(spell_id);
}
void Lua_Mob::SetBuffDuration(int spell_id, int duration) {