avoid a lockup condition due to already locked mutexes
This commit is contained in:
parent
b848f78f41
commit
6b73d3617a
@ -1615,7 +1615,7 @@ void LuaInterface::DeletePendingSpells(bool all) {
|
||||
|
||||
if(!all) {
|
||||
if (spell->caster && spell->caster->GetZone()) {
|
||||
spell->caster->GetZone()->GetSpellProcess()->DeleteActiveSpell(spell);
|
||||
spell->caster->GetZone()->GetSpellProcess()->DeleteActiveSpell(spell, true);
|
||||
}
|
||||
else if(spell->targets.size() > 0 && spell->caster && spell->caster->GetZone()) {
|
||||
spell->MSpellTargets.readlock(__FUNCTION__, __LINE__);
|
||||
@ -1623,7 +1623,7 @@ void LuaInterface::DeletePendingSpells(bool all) {
|
||||
Spawn* target = spell->caster->GetZone()->GetSpawnByID(spell->targets.at(i));
|
||||
if (!target || !target->IsEntity())
|
||||
continue;
|
||||
target->GetZone()->GetSpellProcess()->DeleteActiveSpell(spell);
|
||||
target->GetZone()->GetSpellProcess()->DeleteActiveSpell(spell, true);
|
||||
}
|
||||
spell->MSpellTargets.releasereadlock(__FUNCTION__, __LINE__);
|
||||
}
|
||||
|
@ -3026,7 +3026,8 @@ void SpellProcess::AddSelfAndPetToCharTargets(LuaSpell* spell, Spawn* caster, bo
|
||||
spell->char_id_targets.insert(make_pair(charID, 0x00));
|
||||
}
|
||||
|
||||
void SpellProcess::DeleteActiveSpell(LuaSpell* spell) {
|
||||
void SpellProcess::DeleteActiveSpell(LuaSpell* spell, bool skipRemoveCurrent) {
|
||||
if(!skipRemoveCurrent)
|
||||
lua_interface->RemoveCurrentSpell(spell->state, spell, true);
|
||||
active_spells.Remove(spell, true, 2000);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ public:
|
||||
void AddActiveSpell(LuaSpell* spell);
|
||||
static void AddSelfAndPet(LuaSpell* spell, Spawn* self, bool onlyPet=false);
|
||||
static void AddSelfAndPetToCharTargets(LuaSpell* spell, Spawn* caster, bool onlyPet=false);
|
||||
void DeleteActiveSpell(LuaSpell* spell);
|
||||
void DeleteActiveSpell(LuaSpell* spell, bool skipRemoveCurrent = false);
|
||||
static bool AddLuaSpellTarget(LuaSpell* lua_spell, int32 id, bool lock_spell_targets = true);
|
||||
mutable std::shared_mutex MSpellProcess;
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user