MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / ReleaseMapInstance

Method ReleaseMapInstance

src/plugin/kernel/src/AFCMapModule.cpp:261–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261bool AFCMapModule::ReleaseMapInstance(const int map_id, const int inst_id)
262{
263 auto pMapInfo = map_infos_.find_value(map_id);
264 if (nullptr == pMapInfo)
265 {
266 return false;
267 }
268
269 if (!pMapInfo->ExistInstance(inst_id))
270 {
271 return false;
272 }
273
274 AFCDataList listObject;
275
276 if (GetInstEntityList(map_id, inst_id, listObject))
277 {
278 for (size_t i = 0; i < listObject.GetCount(); ++i)
279 {
280 AFGUID ident = listObject.Int64(i);
281
282 if (!m_pKernelModule->DestroyEntity(ident))
283 {
284 ARK_LOG_ERROR("Destory entity failed, id = {}, please check", ident);
285 }
286 }
287 }
288
289 pMapInfo->RemoveInstance(inst_id);
290
291 return true;
292}
293
294bool AFCMapModule::ExitMapInstance(const int map_id, const int inst_id)
295{

Callers

nothing calls this directly

Calls 6

ExistInstanceMethod · 0.80
Int64Method · 0.80
DestroyEntityMethod · 0.80
RemoveInstanceMethod · 0.80
find_valueMethod · 0.45
GetCountMethod · 0.45

Tested by

no test coverage detected