mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +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.
(cherrypicked from 86da1a19bb)
This commit is contained in:
@@ -221,7 +221,7 @@ void ObjectGridStoper::Visit(CreatureMapType &m)
|
||||
iter->GetSource()->RemoveAllDynObjects();
|
||||
iter->GetSource()->RemoveAllAreaTriggers();
|
||||
|
||||
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