Skip to content

Commit 363b75c

Browse files
committed
overwrite default zero scores
closes #1
1 parent b0d3b3c commit 363b75c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/host/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub(crate) fn get_friend<'b>(
224224
fn insert_my_score(scores: &mut [i16; 8], new_score: i16) {
225225
let mut idx = None;
226226
for (i, old_score) in scores.iter().enumerate() {
227-
if new_score > *old_score {
227+
if new_score > *old_score || *old_score == 0 {
228228
idx = Some(i);
229229
break;
230230
}
@@ -244,7 +244,7 @@ fn insert_friend_score(scores: &mut [FriendScore; 8], friend_id: u16, new_score:
244244
// Skip all scores higher than the new one.
245245
let mut start = 0;
246246
for friend in scores.iter() {
247-
if new_score >= friend.score {
247+
if new_score > friend.score || friend.score == 0 {
248248
break;
249249
}
250250
// If we already filled the scoreboard and the given friend

0 commit comments

Comments
 (0)