fix: overflow when incrementing dice_roll_count
This commit is contained in:
parent
b92c9eb7ff
commit
cb30fd3229
|
|
@ -610,7 +610,9 @@ impl GameState {
|
|||
|
||||
fn inc_roll_count(&mut self, player_id: PlayerId) {
|
||||
self.players.get_mut(&player_id).map(|p| {
|
||||
p.dice_roll_count += 1;
|
||||
if p.dice_roll_count < u8::MAX {
|
||||
p.dice_roll_count += 1;
|
||||
}
|
||||
p
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue