From: Christian Heller Date: Wed, 29 May 2013 02:28:29 +0000 (+0200) Subject: Always load seed file if it exists. Don't provide a default one. X-Git-Tag: tce~1267 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/static/%7B%7Bprefix%7D%7D/task?a=commitdiff_plain;h=6977fdf9517c4d4c46673ac047fb1dd9d6130556;p=plomrogue Always load seed file if it exists. Don't provide a default one. --- 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