From a1266d0197e81600afaab77c6d6544361b2edd71 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 10 Feb 2010 06:02:19 +0100 Subject: [PATCH] time_stop_conditions(): Select byoyomi/main by period type, not main_time==0 --- timeinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/timeinfo.c b/timeinfo.c index 3b1a289..4e5b088 100644 --- a/timeinfo.c +++ b/timeinfo.c @@ -186,9 +186,9 @@ time_stop_conditions(struct time_info *ti, struct board *b, int fuseki_end, int /* Ideal/reasonable time to spend on the move. */ double recommended_time; - if (!ti->len.t.main_time) { + if (ti->period == TT_MOVE) { /* We are in byoyomi! */ - assert(ti->period == TT_MOVE); + assert(!ti->len.t.main_time); max_time = ti->len.t.byoyomi_time; assert(ti->len.t.byoyomi_stones > 0); @@ -203,10 +203,10 @@ time_stop_conditions(struct time_info *ti, struct board *b, int fuseki_end, int net_lag = safe_margin; } - } else { + } else { assert(ti->period == TT_TOTAL); /* We are in main time. */ - assert(ti->period == TT_TOTAL); + assert(ti->len.t.main_time > 0); max_time = recommended_time = ti->len.t.main_time; int moves_left = board_estimated_moves_left(b); -- 2.11.4.GIT