/* src/server/init.c */
#include "init.h"
+#include <errno.h> /* errno */
#include <stddef.h> /* NULL */
#include <stdint.h> /* uint32_t */
#include <stdlib.h> /* exit(), free() */
#include <string.h> /* atoi() */
#include <time.h> /* time() */
-#include <unistd.h> /* optarg, getopt(), access() */
+#include <unistd.h> /* optarg, getopt(), access(), unlink() */
#include "../common/readwrite.h" /* try_fopen(), try_fclose(), textfile_sizes(),
* try_fgets()
*/
add_map_objects(4, 1 + rrand() % 3);
add_map_objects(5, 1 + rrand() % 3);
set_cleanup_flag(CLEANUP_MAP_OBJECTS);
+ int test = unlink(world.path_record);
+ char * err = "remake_world() fails to unlink() record file.";
+ exit_err(test && errno != ENOENT, err);
}
extern void obey_argv(int argc, char * argv[]);
/* Dissolves old game world if it exists, and generates a new one from "seed".
+ * Unlinks any pre-existing file at world.path_record to re-start record.
*
* Map object (action) definitions read in from server config directory are not
* affected. world.last_update_turn is set to 0 and world.turn to 1, so that