From 6977fdf9517c4d4c46673ac047fb1dd9d6130556 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 29 May 2013 04:28:29 +0200 Subject: [PATCH] Always load seed file if it exists. Don't provide a default one. --- roguelike.c | 14 +++++--------- seed | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 seed diff --git a/roguelike.c b/roguelike.c index 7caaec9..cba46ad 100644 --- a/roguelike.c +++ b/roguelike.c @@ -187,15 +187,11 @@ void player_wait (struct World * world) { update_log (world, "\nYou wait."); } int main (int argc, char *argv[]) { - uint32_t seed = time(NULL); - int opt; - while ((opt = getopt(argc, argv, "l")) != -1) { - switch (opt) { - case 'l': - seed = load_seed(); - break; - default: - exit(EXIT_FAILURE); } } + uint32_t seed; + if (0 == access("seed", F_OK)) + seed = load_seed(); + else + seed = time(NULL); rrand(1, seed); struct World world; diff --git a/seed b/seed deleted file mode 100644 index 717e474..0000000 --- a/seed +++ /dev/null @@ -1 +0,0 @@ -Q¤' \ No newline at end of file -- 2.30.2