Remove/Add creature from/to map when it changes map.
Note: creatures was never supposed to change map, but now the core allows them to move with transports...
This commit is contained in:
@@ -13710,7 +13710,7 @@ void Unit::RemoveFromWorld()
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::CleanupsBeforeDelete(bool finalCleanup)
|
||||
void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
{
|
||||
// This needs to be before RemoveFromWorld to make GetCaster() return a valid pointer on aura removal
|
||||
InterruptNonMeleeSpells(true);
|
||||
@@ -13734,6 +13734,11 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup)
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().setOnlineOfflineState(false);
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
}
|
||||
|
||||
void Unit::CleanupsBeforeDelete(bool finalCleanup)
|
||||
{
|
||||
CleanupBeforeRemoveFromMap(finalCleanup);
|
||||
|
||||
if (Creature* thisCreature = ToCreature())
|
||||
if (GetTransport())
|
||||
|
||||
@@ -1247,6 +1247,7 @@ class Unit : public WorldObject
|
||||
void AddToWorld();
|
||||
void RemoveFromWorld();
|
||||
|
||||
void CleanupBeforeRemoveFromMap(bool finalCleanup);
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true); // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
|
||||
Reference in New Issue
Block a user