MCPcopy Create free account
hub / github.com/cuberite/cuberite / RemoveObjective

Method RemoveObjective

src/Scoreboard.cpp:308–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306
307
308bool cScoreboard::RemoveObjective(const AString & a_Name)
309{
310 cCSLock Lock(m_CSObjectives);
311
312 cObjectiveMap::iterator it = m_Objectives.find(a_Name);
313
314 if (it == m_Objectives.end())
315 {
316 return false;
317 }
318
319 ASSERT(m_World != NULL);
320 m_World->BroadcastScoreboardObjective(it->second.GetName(), it->second.GetDisplayName(), 1);
321
322 for (unsigned int i = 0; i < (unsigned int) dsCount; ++i)
323 {
324 if (m_Display[i] == &it->second)
325 {
326 SetDisplay(NULL, (eDisplaySlot) i);
327 }
328 }
329
330 m_Objectives.erase(it);
331
332 return true;
333}
334
335
336

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected