fix: overflow when incrementing dice_roll_count

This commit is contained in:
Henri Bourcereau 2025-07-25 17:41:48 +02:00
parent b92c9eb7ff
commit cb30fd3229

View file

@ -610,7 +610,9 @@ impl GameState {
fn inc_roll_count(&mut self, player_id: PlayerId) {
self.players.get_mut(&player_id).map(|p| {
if p.dice_roll_count < u8::MAX {
p.dice_roll_count += 1;
}
p
});
}