From: Ian Jackson Date: Sat, 20 Mar 2021 21:28:43 +0000 (+0000) Subject: clock: Give Y an extra per_move X-Git-Tag: otter-0.5.0~614 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9abfca43ffdb600557956d41d2d936bcdcb15386;p=otter.git clock: Give Y an extra per_move This breaks detection of whether we're reset. We'll fix that in a moment. Signed-off-by: Ian Jackson --- diff --git a/src/clock.rs b/src/clock.rs index 675c0a93..27a8690e 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -115,6 +115,11 @@ impl State { for ust in &mut self.users { ust.remaining = spec.initial_time(); } + // White is player Y, and they will ge to go first, so the clock + // will go from stopped to Y, and then later when it's X's turn + // X will get an extra per_move. Y therefore needs per_move too. + let y_remaining = &mut self.users[USERS[0]].remaining; + *y_remaining = *y_remaining + TVL::seconds(spec.per_move.into()); } fn implies_running(&self, held: Option) -> Option {