Restore player alias being displayed in chat

This commit is contained in:
scott-c 2020-05-20 11:37:14 +08:00
parent 66f6368e83
commit 636fcafd2e

View File

@ -406,16 +406,22 @@ impl<'a> System<'a> for Sys {
} else { } else {
let bubble = SpeechBubble::player_new(message.clone(), *time); let bubble = SpeechBubble::player_new(message.clone(), *time);
let _ = speech_bubbles.insert(entity, bubble); let _ = speech_bubbles.insert(entity, bubble);
match stats.get(entity) { format!(
Some(stat) => { "{}[{}] {}: {}",
if admins.get(entity).is_some() { match admins.get(entity) {
format!("[ADMIN][{}] {}", &stat.name, message) Some(_) => "[ADMIN]",
} else { None => "",
format!("[{}] {}", &stat.name, message)
}
}, },
None => format!("[<Unknown>] {}", message), match players.get(entity) {
} Some(player) => &player.alias,
None => "<Unknown>",
},
match stats.get(entity) {
Some(stat) => &stat.name,
None => "<Unknown>",
},
message
)
} }
} else { } else {
message message