Ejemplo n.º 1
0
 void UpdateAI(const uint32 diff)
 {
     if (me->isSpawned() && cleansedGuid)
     {
         GameObject* cleansed = me->GetMap()->GetGameObject(cleansedGuid);
         if (cleansed)
             cleansed->AddObjectToRemoveList();
         cleansedGuid.Clear();
     }
 }
Ejemplo n.º 2
0
void PoolGroup<GameObject>::Despawn1Object(ObjectGuid::LowType guid)
{
    if (GameObjectData const* data = sObjectMgr->GetGOData(guid))
    {
        sObjectMgr->RemoveGameobjectFromGrid(guid, data);

        Map* map = sMapMgr->CreateBaseMap(data->mapid);
        if (!map->Instanceable())
        {
            auto gameobjectBounds = map->GetGameObjectBySpawnIdStore().equal_range(guid);
            for (auto itr = gameobjectBounds.first; itr != gameobjectBounds.second;)
            {
                GameObject* go = itr->second;
                ++itr;
                go->AddObjectToRemoveList();
            }
        }
    }
}
Ejemplo n.º 3
0
void PoolGroup<GameObject>::Despawn1Object(ObjectGuid::LowType guid)
{
    if (GameObjectData const* data = sObjectMgr->GetGameObjectData(guid))
    {
        sObjectMgr->RemoveGameobjectFromGrid(guid, data);

        Map* map = sMapMgr->CreateBaseMap(data->spawnPoint.GetMapId());
        if (!map->Instanceable())
        {
            auto gameobjectBounds = map->GetGameObjectBySpawnIdStore().equal_range(guid);
            for (auto itr = gameobjectBounds.first; itr != gameobjectBounds.second;)
            {
                GameObject* go = itr->second;
                ++itr;

                // For dynamic spawns, save respawn time here
                if (!go->GetRespawnCompatibilityMode())
                    go->SaveRespawnTime(0, false);
                go->AddObjectToRemoveList();
            }
        }
    }
}