void ZOLists::RemoveObject(ZObject *obj) { RemoveObjectFromList(obj, object_list); RemoveObjectFromList(obj, &flag_olist); RemoveObjectFromList(obj, &cannon_olist); RemoveObjectFromList(obj, &building_olist); RemoveObjectFromList(obj, &rock_olist); RemoveObjectFromList(obj, &passive_engagable_olist); RemoveObjectFromList(obj, &mobile_olist); RemoveObjectFromList(obj, &prender_olist); RemoveObjectFromList(obj, &non_mapitem_olist); RemoveObjectFromList(obj, &grenades_olist); }
void CLiteObjectMgr::RemoveObject(GameBaseLite *pObject) { // Remove it from our list bool bRemoveResult; if (pObject->IsActive()) { bRemoveResult = RemoveObjectFromList(m_aActiveObjects, pObject); --m_nNumActiveObjects; ASSERT(!IsObjectInList(m_aInactiveObjects, pObject)); } else { bRemoveResult = RemoveObjectFromList(m_aInactiveObjects, pObject); --m_nNumInactiveObjects; ASSERT(!IsObjectInList(m_aActiveObjects, pObject)); } // Remove it from the map TNameMap::iterator iObjectNamePos = m_aNameMap.find(pObject->GetName()); if ((iObjectNamePos != m_aNameMap.end()) && (iObjectNamePos->second == pObject)) m_aNameMap.erase(iObjectNamePos); // Make sure it's not in the initialupdate list RemoveObjectFromList(m_aInitialUpdateObjects, pObject); RemoveObjectFromList(m_aInitialUpdateObjectsLoad, pObject); // Clean it up in the engine if (bRemoveResult) { g_pLTServer->RemoveObject(pObject->GetClass(), pObject); } else { ASSERT(!"Invalid lite object removal encountered"); return; } // You're dirty... SetDirty(eDirty_ObjectLists); }
void CLiteObjectMgr::DeactivateObject(GameBaseLite *pObject) { // Make sure we're going about this the right way if (pObject->IsActive()) { pObject->Deactivate(); return; } // Remove them from the inactive list if (!RemoveObjectFromList(m_aActiveObjects, pObject)) { ASSERT(IsObjectInList(m_aInactiveObjects, pObject)); return; } --m_nNumActiveObjects; // Put it in the active list AddInactiveObject(pObject); SetDirty(); }
void ZOLists::DeleteObjectFromList(ZObject *obj, vector<ZObject*> *olist) { RemoveObjectFromList(obj, olist); delete obj; }