| 109 | m_locations->registry().init(id); // actor's id |
| 110 | } |
| 111 | CMapLocation* CMapManager::AddMapLocation(const shared_str& spot_type, u16 id) |
| 112 | { |
| 113 | FindLocationBySpotID key(spot_type, id); |
| 114 | Locations_it it = std::find_if(Locations().begin(), Locations().end(), key); |
| 115 | if (it == Locations().end()) |
| 116 | { |
| 117 | CMapLocation* l = xr_new<CMapLocation>(*key.spot_id, key.object_id); |
| 118 | Locations().emplace_back(key.spot_id, key.object_id).location = l; |
| 119 | if (g_actor) |
| 120 | Actor()->callback(GameObject::eMapLocationAdded)(*spot_type, id); |
| 121 | return l; |
| 122 | } |
| 123 | else |
| 124 | (*it).location->AddRef(); |
| 125 | |
| 126 | return (*it).location; |
| 127 | } |
| 128 | |
| 129 | CMapLocation* CMapManager::AddRelationLocation(CInventoryOwner* pInvOwner) |
| 130 | { |
no test coverage detected