aboutsummaryrefslogtreecommitdiff
path: root/server/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands.rs')
-rw-r--r--server/src/commands.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs
index 5eed1109..2d9ba967 100644
--- a/server/src/commands.rs
+++ b/server/src/commands.rs
@@ -311,10 +311,15 @@ impl Server {
}
Command::Scoreboard { map, text } => {
let mapname = map.as_ref().unwrap_or(&self.game.data.current_map);
-
+ let mapname_pretty = &self
+ .index
+ .maps
+ .get(mapname)
+ .ok_or(tre!("s.error.scoreboard_disabled"))?
+ .name;
if let Some(board) = self.scoreboard.get(mapname) {
if text {
- let mut o = format!("Scoreboard for {mapname}:\n");
+ let mut o = format!("Scoreboard for {mapname_pretty}:\n");
for (i, entry) in board.best.iter().take(5).enumerate() {
writeln!(
o,
@@ -330,7 +335,7 @@ impl Server {
});
} else {
let mut board = board.to_owned();
- board.map = Some(mapname.to_string());
+ board.map = Some(mapname_pretty.to_string());
replies.push(PacketC::Menu(Menu::Scoreboard(board)));
}
} else {