Merge pull request #2991 from megamage/master

Core/Entities: Do not call AddObjectToRemoveList(Pet*) in Map::MoveAllCreaturesInMoveList() - Closes #2892.
Scripts: Fix a crash in npc_brunnhildar_prisoner script. Closes #2825.
This commit is contained in:
QAston committed 2011-09-14 14:27:21 -07:00
commit decb20f079
2 files changed
+35 -8

No files matched your search

+12 -3
View File
@@ -832,7 +832,16 @@ void Map::MoveAllCreaturesInMoveList()
#ifdef TRINITY_DEBUG
sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.", c->GetGUIDLow(), c->GetEntry());
#endif
AddObjectToRemoveList(c);
//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
//TODO: pets will disappear if this is outside CreatureRespawnRelocation
//need to check why pet is frequently relocated to an unloaded cell
if (c->isPet())
((Pet*)c)->Remove(PET_SAVE_NOT_IN_SLOT, true);
else
AddObjectToRemoveList(c);
}
}
@@ -925,8 +934,8 @@ bool Map::CreatureRespawnRelocation(Creature *c)
c->UpdateObjectVisibility(false);
return true;
}
else
return false;
return false;
}
bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll)