From de443f416439bc535f0b90c16bca05e5c6896463 Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Sat, 2 Jul 2011 14:59:36 +0200 Subject: [PATCH] time_left(): give precedence to gtp peer for byoyomi This avoids incorrect "LOST ON TIME internally" with main_time > 0. --- timeinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/timeinfo.c b/timeinfo.c index 6c4542b..71a45a7 100644 --- a/timeinfo.c +++ b/timeinfo.c @@ -113,13 +113,15 @@ time_left(struct time_info *ti, int time_left, int stones_left) /* Some GTP peers send time_left 0 0 at the end of main time. */ ti->period = TT_MOVE; ti->len.t.main_time = 0; - /* byoyomi_time kept fully charged. */ + ti->len.t.byoyomi_time = ti->len.t.byoyomi_time_max; + ti->len.t.byoyomi_stones = ti->len.t.byoyomi_stones_max; } else if (!stones_left) { /* Main time */ ti->period = TT_TOTAL; ti->len.t.main_time = time_left; - /* byoyomi_time kept fully charged. */ + ti->len.t.byoyomi_time = ti->len.t.byoyomi_time_max; + ti->len.t.byoyomi_stones = ti->len.t.byoyomi_stones_max; } else { /* Byoyomi */ -- 2.11.4.GIT