From 05f2713179884de7eeda79f4db577bd13ac3d5e8 Mon Sep 17 00:00:00 2001 From: Tiehuis Date: Wed, 25 Feb 2015 18:58:36 +1300 Subject: [PATCH] Alter engine so we can init a gamestate with no arguments. May be able to be utilized in ai code --- src/engine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine.c b/src/engine.c index e38c7be..5ae9346 100644 --- a/src/engine.c +++ b/src/engine.c @@ -218,7 +218,9 @@ static int digits_ceiling(unsigned int n) * through this function */ struct gamestate* gamestate_init(int argc, char **argv) { - struct gameoptions *opt = parse_options(gameoptions_default(), argc, argv); + struct gameoptions *opt = gameoptions_default(); + if (argc != 0) parse_options(opt, argc, argv); + if (!opt) return NULL; srand(time(NULL));