Prevent time until next battlemode change from being displayed as negative

This commit is contained in:
Keegan-JW 2024-01-21 13:35:09 +00:00 committed by Illia Denysenko
parent 100568f955
commit 77d6492dbf

View File

@ -4009,9 +4009,12 @@ fn handle_battlemode(
let Time(change) = change; let Time(change) = change;
let elapsed = time - change; let elapsed = time - change;
let next = COOLDOWN - elapsed; let next = COOLDOWN - elapsed;
if next > 0.0 {
let notice = format!(" Next change will be available in: {:.0} seconds", next); let notice = format!(" Next change will be available in: {:.0} seconds", next);
msg.push_str(&notice); msg.push_str(&notice);
} }
}
server.notify_client( server.notify_client(
client, client,
ServerGeneral::server_msg(ChatType::CommandInfo, msg), ServerGeneral::server_msg(ChatType::CommandInfo, msg),