| 283 | |
| 284 | |
| 285 | cObjective* cScoreboard::RegisterObjective(const AString & a_Name, const AString & a_DisplayName, cObjective::eType a_Type) |
| 286 | { |
| 287 | cObjective Objective(a_Name, a_DisplayName, a_Type, m_World); |
| 288 | |
| 289 | std::pair<cObjectiveMap::iterator, bool> Status = m_Objectives.insert(cNamedObjective(a_Name, Objective)); |
| 290 | |
| 291 | if (Status.second) |
| 292 | { |
| 293 | ASSERT(m_World != NULL); |
| 294 | m_World->BroadcastScoreboardObjective(a_Name, a_DisplayName, 0); |
| 295 | |
| 296 | return &Status.first->second; |
| 297 | } |
| 298 | else |
| 299 | { |
| 300 | return NULL; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | |
| 305 |
no test coverage detected