summaryrefslogtreecommitdiffstats
path: root/src/Scoreboard.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-03-02 20:25:05 +0100
committerandrew <xdotftw@gmail.com>2014-03-02 20:25:05 +0100
commit070d483236279e69c736e740fa8459d3ac627790 (patch)
treed4431ca58c236556056e041b3d888ea61e7ac144 /src/Scoreboard.cpp
parentFixed MSVC warnings in DeprecatedBindings. (diff)
downloadcuberite-070d483236279e69c736e740fa8459d3ac627790.tar
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.gz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.bz2
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.lz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.xz
cuberite-070d483236279e69c736e740fa8459d3ac627790.tar.zst
cuberite-070d483236279e69c736e740fa8459d3ac627790.zip
Diffstat (limited to 'src/Scoreboard.cpp')
-rw-r--r--src/Scoreboard.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp
index 05fd0314d..c1da27086 100644
--- a/src/Scoreboard.cpp
+++ b/src/Scoreboard.cpp
@@ -312,12 +312,18 @@ bool cScoreboard::RemoveObjective(const AString & a_Name)
return false;
}
- m_Objectives.erase(it);
-
ASSERT(m_World != NULL);
m_World->BroadcastScoreboardObjective(it->second.GetName(), it->second.GetDisplayName(), 1);
- // TODO 2014-03-01 xdot: Remove objective from display slot
+ for (unsigned int i = 0; i < (unsigned int) dsCount; ++i)
+ {
+ if (m_Display[i] == &it->second)
+ {
+ SetDisplay(NULL, (eDisplaySlot) i);
+ }
+ }
+
+ m_Objectives.erase(it);
return true;
}