mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update). * Properly clear ComboPoint references on player remove * remove some possible references item may have when it is deleted during save. * Also clear all hostile references when unit is removed from map.
This commit is contained in:
@@ -216,7 +216,7 @@ void ObjectGridStoper::Visit(CreatureMapType &m)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
iter->GetSource()->RemoveAllDynObjects();
|
||||
if (iter->GetSource()->IsInCombat())
|
||||
if (iter->GetSource()->IsInCombat() || !iter->GetSource()->getThreatManager().areThreatListsEmpty())
|
||||
{
|
||||
iter->GetSource()->CombatStop();
|
||||
iter->GetSource()->DeleteThreatList();
|
||||
|
||||
Reference in New Issue
Block a user