Core/Units: fixed a possible crash location caused by nullpointers
This commit is contained in:
1 parent
a59ea8fc6d
commit
ddb9c2a698
1 file changed
+3
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user