From 4d3718bab996ec5693bf7a9b0affe18c80f9d273 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 May 2018 18:05:35 +0200 Subject: [PATCH] find out why t<=0 assert happens sometimes --- src/kernel/calendar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kernel/calendar.c b/src/kernel/calendar.c index df9f6c204..93722b5bc 100644 --- a/src/kernel/calendar.c +++ b/src/kernel/calendar.c @@ -4,7 +4,8 @@ #include "calendar.h" #include "move.h" /* storms */ -#include +#include "kernel/config.h" +#include "util/log.h" #include #include @@ -45,6 +46,10 @@ const gamedate *get_gamedate(int turn_now, gamedate * gd) int t = turn_now - first_turn(); assert(gd); + if (t<0) { + log_fatal("current turn %d is before first %d", + turn_now, first_turn()); + } assert(t>=0); gd->turn = turn_now;