MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / AddRemoveMapSpot

Method AddRemoveMapSpot

ogsr_engine/xrGame/SimpleDetectorSHOC.cpp:275–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void CCustomDetectorSHOC::AddRemoveMapSpot(CCustomZone* pZone, bool bAdd)
276{
277 if (m_ZoneTypeMap.find(pZone->CLS_ID) == m_ZoneTypeMap.end())
278 return;
279
280 if (bAdd && !pZone->VisibleByDetector())
281 return;
282
283 ZONE_TYPE_SHOC& zone_type = m_ZoneTypeMap[pZone->CLS_ID];
284
285 if (xr_strlen(zone_type.zone_map_location))
286 {
287 if (bAdd && pZone->IsEnabled())
288 {
289 if (!Level().MapManager().HasMapLocation(*zone_type.zone_map_location, pZone->ID()))
290 Level().MapManager().AddMapLocation(*zone_type.zone_map_location, pZone->ID());
291 }
292 else
293 {
294 if (Level().MapManager().HasMapLocation(*zone_type.zone_map_location, pZone->ID()))
295 Level().MapManager().RemoveMapLocation(*zone_type.zone_map_location, pZone->ID());
296 }
297 }
298}
299
300void CCustomDetectorSHOC::UpdateMapLocations() // called on turn on/off only
301{

Callers

nothing calls this directly

Calls 8

VisibleByDetectorMethod · 0.80
HasMapLocationMethod · 0.80
AddMapLocationMethod · 0.80
RemoveMapLocationMethod · 0.80
xr_strlenFunction · 0.50
findMethod · 0.45
endMethod · 0.45
IsEnabledMethod · 0.45

Tested by

no test coverage detected