Core/Units: fixed a possible crash location caused by nullpointers

This commit is contained in:
Ovalord committed 2018-03-15 22:06:03 +01:00
1 parent a59ea8fc6d
commit ddb9c2a698
1 file changed
+3 -3
+3 -3
View File
@@ -10139,9 +10139,6 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
// This needs to be before RemoveFromWorld to make GetCaster() return a valid pointer on aura removal
InterruptNonMeleeSpells(true);
if (IsInWorld())
RemoveFromWorld();
ASSERT(GetGUID());
// A unit may be in removelist and not in world, but it is still in grid
@@ -10157,6 +10154,9 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
ClearComboPointHolders();
DeleteThreatList();
getHostileRefManager().deleteReferences();
if (IsInWorld())
RemoveFromWorld();
}
void Unit::CleanupsBeforeDelete(bool finalCleanup)