From 367921952ae57c3d54bb422734678e33f0ece93d Mon Sep 17 00:00:00 2001 From: Jean-loup Gailly Date: Sat, 5 Feb 2011 11:01:13 +0100 Subject: [PATCH] board_effective_handicap(): Always return 0 for even games --- tactics/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tactics/util.c b/tactics/util.c index 610ba6f..97066f9 100644 --- a/tactics/util.c +++ b/tactics/util.c @@ -90,7 +90,12 @@ board_effective_handicap(struct board *b, int first_move_value) /* This can happen if the opponent passes during handicap * placing phase. */ // assert(b->handicap != 1); - return (b->handicap ? b->handicap : 1) * first_move_value + 0.5 - b->komi; + + /* Always return 0 for even games, in particular if + * first_move_value is set on purpose to a value different + * from the correct theoretical value (2*komi). */ + if (!b->handicap) return 0; + return b->handicap * first_move_value + 0.5 - b->komi; } -- 2.11.4.GIT