From be94a98d0704edf13bb5b2098cf54571d864f45b Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 10 Nov 2025 12:46:48 +0100 Subject: Show pretty map name in scoreboard (fix #500) --- server/src/commands.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server') 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 { -- cgit v1.3