commit 9409aa509f50043587231043257da1b69163b5b0 parent 0ced32687a9c472eff86209688c98b0601925290 Author: MikoĊaj Lenczewski <mblenczewski@gmail.com> Date: Fri, 3 Jan 2025 16:53:05 +0000 Fix divide-by-zero bug in hexes if we reach the end of a game Diffstat:
M | agents/hexes/src/hexes.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/hexes/src/hexes.c b/agents/hexes/src/hexes.c @@ -239,7 +239,7 @@ send_handler(struct game *game) .type = HEX_MSG_MOVE, }; - size_t total_rounds = (game->board.size * game->board.size) / 2; + size_t total_rounds = ((game->board.size * game->board.size) / 2) + 1; struct timespec timeout = { .tv_sec = game->timer.tv_sec / (total_rounds - game->round),