Merge branch 'master' into 'master'

Prevent time until next battlemode change from being displayed as negative

See merge request veloren/veloren!4205
This commit is contained in:
Illia Denysenko 2024-01-21 13:35:09 +00:00
commit 727d32c104

View File

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