mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Do not call AddObjectToRemoveList(Pet*) in Map::MoveAllCreaturesInMoveList(). Fix #2892.
This commit is contained in:
@@ -824,9 +824,17 @@ void Map::MoveAllCreaturesInMoveList()
|
||||
}
|
||||
else
|
||||
{
|
||||
//AddObjectToRemoveList(Pet*) should only be called in Pet::Remove
|
||||
//This may happen when a player just logs in and a pet moves to a nearby unloaded cell
|
||||
//To avoid this, we can load nearby cells when player log in
|
||||
//But this check is always needed to ensure safety
|
||||
if (c->isPet())
|
||||
{
|
||||
((Pet*)c)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
// if creature can't be move in new cell/grid (not loaded) move it to repawn cell/grid
|
||||
// creature coordinates will be updated and notifiers send
|
||||
if (!CreatureRespawnRelocation(c))
|
||||
else if (!CreatureRespawnRelocation(c))
|
||||
{
|
||||
// ... or unload (if respawn grid also not loaded)
|
||||
#ifdef TRINITY_DEBUG
|
||||
|
||||
Reference in New Issue
Block a user