[11819] move SetActiveObjectState to WorldObject level

This commit is contained in:
SilverIce 2011-10-13 20:08:25 +03:00
parent 012be82c86
commit df0715284f
7 changed files with 23 additions and 29 deletions

View file

@ -1081,9 +1081,11 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const
void Map::AddToActive( WorldObject* obj )
{
m_activeNonPlayers.insert(obj);
Cell cell = Cell(MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()));
EnsureGridLoaded(cell);
// also not allow unloading spawn grid to prevent creating creature clone at load
if (obj->GetTypeId()==TYPEID_UNIT)
if (obj->GetTypeId() == TYPEID_UNIT)
{
Creature* c= (Creature*)obj;