Fixed divided by 0 error

This commit is contained in:
xeovalyte 2024-06-28 14:51:09 +02:00
parent c8d46a02b7
commit 2a80cb78b5
Signed by: xeovalyte
SSH Key Fingerprint: SHA256:kSQDrQDmKzljJzfGYcd3m9RqHi4h8rSwkZ3sQ9kBURo
2 changed files with 16 additions and 4 deletions

View File

@ -106,9 +106,21 @@ fn sort_by_total_score(
.enumerate()
.collect();
let lifesaver_best = lifesaver_best.get();
let popduiken_best = popduiken_best.get();
let hindernis_best = hindernis_best.get();
let mut lifesaver_best = lifesaver_best.get();
let mut popduiken_best = popduiken_best.get();
let mut hindernis_best = hindernis_best.get();
if lifesaver_best == 0 {
lifesaver_best = 10 * 60 * 1000;
}
if popduiken_best == 0 {
popduiken_best = 10 * 60 * 1000;
}
if hindernis_best == 0 {
hindernis_best = 10 * 60 * 1000;
}
all_participants.sort_by(|(_, a), (_, b)| {
let part_a = match a.value.get().events {

View File

@ -9,7 +9,7 @@ pub fn init_websocket() {
ready_state,
message,
..
} = use_websocket("ws://192.168.100.122:3000/ws");
} = use_websocket("ws://192.168.0.150:3000/ws");
provide_context(ready_state);