show defeat status in tournament team info

This commit is contained in:
Martin Michelsen
2023-09-29 23:36:08 -07:00
parent a0ff0cf8e7
commit 403c17b42d
+8 -6
View File
@@ -1536,15 +1536,17 @@ static void on_09(shared_ptr<Client> c, uint16_t, uint32_t, const string& data)
if (team->name.empty()) { if (team->name.empty()) {
message = "(No registrant)"; message = "(No registrant)";
} else if (team->max_players == 1) { } else if (team->max_players == 1) {
message = string_printf("$C6%s$C7\n%zu %s\nPlayers:", message = string_printf("$C6%s$C7\n%zu %s (%s)\nPlayers:",
team->name.c_str(),
team->num_rounds_cleared,
team->num_rounds_cleared == 1 ? "win" : "wins");
} else {
message = string_printf("$C6%s$C7\n%zu %s%s\nPlayers:",
team->name.c_str(), team->name.c_str(),
team->num_rounds_cleared, team->num_rounds_cleared,
team->num_rounds_cleared == 1 ? "win" : "wins", team->num_rounds_cleared == 1 ? "win" : "wins",
team->is_active ? "active" : "defeated");
} else {
message = string_printf("$C6%s$C7\n%zu %s (%s)%s\nPlayers:",
team->name.c_str(),
team->num_rounds_cleared,
team->num_rounds_cleared == 1 ? "win" : "wins",
team->is_active ? "active" : "defeated",
team->password.empty() ? "" : "\n$C4Locked$C7"); team->password.empty() ? "" : "\n$C4Locked$C7");
} }
for (const auto& player : team->players) { for (const auto& player : team->players) {