Core/Misc: Fix various crashes, also related to multithreading
Port From (https://github.com/TrinityCore/TrinityCore/commit/ad008c43b75080ec59aa973f1e2e4424332c34a4)
This commit is contained in:
@@ -1741,17 +1741,17 @@ namespace Game.Entities
|
||||
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next())
|
||||
{
|
||||
Player Target = refe.GetSource();
|
||||
if (Target)
|
||||
Player target = refe.GetSource();
|
||||
if (target)
|
||||
{
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target != this && Target.IsAlive() && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target))
|
||||
nearMembers.Add(Target);
|
||||
if (target != this && IsWithinDistInMap(target, radius) && target.IsAlive() && !IsHostileTo(target))
|
||||
nearMembers.Add(target);
|
||||
|
||||
// Push player's pet to vector
|
||||
Unit pet = Target.GetGuardianPet();
|
||||
Unit pet = target.GetGuardianPet();
|
||||
if (pet)
|
||||
if (pet != this && pet.IsAlive() && IsWithinDistInMap(pet, radius) && !IsHostileTo(pet))
|
||||
if (pet != this && IsWithinDistInMap(pet, radius) && pet.IsAlive() && !IsHostileTo(pet))
|
||||
nearMembers.Add(pet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ namespace Game.Entities
|
||||
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map.RemoveAllObjectsInRemoveList
|
||||
CombatStop();
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().setOnlineOfflineState(false);
|
||||
getHostileRefManager().deleteReferences();
|
||||
GetMotionMaster().Clear(false); // remove different non-standard movement generators.
|
||||
}
|
||||
public override void CleanupsBeforeDelete(bool finalCleanup = true)
|
||||
|
||||
Reference in New Issue
Block a user