X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=faf6c011f25a873980f7b42c1c0a0c24a3a858af;hb=refs%2Ftags%2F4.3.0.1;hp=e27c3e7e60280e71a295dbd27206f69e6345530d;hpb=3e44421a400e6349d1e97f047391489bc1b396fb;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index e27c3e7e..faf6c011 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1300,6 +1300,8 @@ void GetOptions(int argc, char *argv[], options.special_flags = NULL; options.debug_mode = NULL; options.player_name = NULL; + options.identifier = NULL; + options.level_nr = NULL; options.mytapes = FALSE; options.serveronly = FALSE; @@ -1446,6 +1448,24 @@ void GetOptions(int argc, char *argv[], if (option_arg == next_option) options_left++; } + else if (strncmp(option, "-identifier", option_len) == 0) + { + if (option_arg == NULL) + FailWithHelp("option '%s' requires an argument", option_str); + + options.identifier = getStringCopy(option_arg); + if (option_arg == next_option) + options_left++; + } + else if (strncmp(option, "-level-nr", option_len) == 0) + { + if (option_arg == NULL) + FailWithHelp("option '%s' requires an argument", option_str); + + options.level_nr = getStringCopy(option_arg); + if (option_arg == next_option) + options_left++; + } else if (strncmp(option, "-verbose", option_len) == 0) { options.verbose = TRUE; @@ -2766,6 +2786,22 @@ int copyFile(char *filename_from, char *filename_to) return 0; } +boolean touchFile(char *filename) +{ + FILE *file; + + if (!(file = fopen(filename, MODE_WRITE))) + { + Warn("cannot touch file '%s'", filename); + + return FALSE; + } + + fclose(file); + + return TRUE; +} + // ---------------------------------------------------------------------------- // functions for directory handling