Skip to content

Commit

Permalink
Don't spam empty settle
Browse files Browse the repository at this point in the history
  • Loading branch information
DogLooksGood committed Feb 10, 2025
1 parent 35935a0 commit e32d589
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,11 @@ impl GameContext {
_ if chg < 0 => Some(BalanceChange::Sub(-chg as u64)),
_ => None,
};
settles_map.entry(player_id)
.and_modify(|e| e.change = change)
.or_insert_with(|| Settle::new(player_id, 0, change, false));
if change.is_some() {
settles_map.entry(player_id)
.and_modify(|e| e.change = change)
.or_insert_with(|| Settle::new(player_id, 0, change, false));
}
}

self.balances = balances;
Expand Down

0 comments on commit e32d589

Please sign in to comment.