added some safety checks for -m

This commit is contained in:
2024-07-21 00:45:55 -04:00
parent 401b5b00b5
commit 176578aeff

View File

@ -53,6 +53,9 @@ feature proc_args(int argc, char **argv,
FEATURE_INVENTORY |
FEATURE_WALK_OVER;
} else if (str == "-R") {
if (result & FEATURE_READ_MAP)
return FEATURE_CONFLICT | i;
result |= FEATURE_REVISIT;
} else if (str == "-e") {
result |= FEATURE_EXTRA_STUFF;
@ -61,7 +64,9 @@ feature proc_args(int argc, char **argv,
} else if (str == "-o") {
result |= FEATURE_WALK_OVER;
} else if (str == "-m") {
if (result & FEATURE_RAND_MAP)
if ((result & FEATURE_RAND_MAP) ||
(result & FEATURE_REVISIT) ||
(result & FEATURE_READ_MAP))
return FEATURE_CONFLICT | i;
result |= FEATURE_READ_MAP;
@ -185,16 +190,16 @@ void panic_args(feature panic) {
const char *ARGS_LIST = "\
-n : Use ncurses for I/O\n\
-r : Randomly generate maps\n\
-r : Randomly generate maps. CANNOT BE USED WITH -m.\n\
-c : Enemies chase the player (CAUTION: THEY CAN REALLY CHASE!!!)\n\
-d : Enemies can go through doors (CAUTION: DO NOT ENABLE WITH CHASING!)\n\
-i : Enable inventory (player can pick up potions, will turn on -o)\n\
-t : Enable throw (will turn on -i)\n\
-R : Enable revisiting levels\n\
-R : Enable revisiting levels. CANNOT BE USED WITH -m.\n\
-e : Enable extra potions and races\n\
-E : Enable extra levels\n\
-o : Allows characters to go over gold and potions\n\
-m [file] : Reads map data from file. CANNOT BE USED WITH -r. DOES NOT PANIC!\n\
-m [file] : Reads map data from file. CANNOT BE USED WITH -r or -R.\n\
-s [seed] : Sets initial seed to seed\n\
-I [file] : Reads commands from file. CANNOT BE USED WITH -n.\n\
-O [file] : Outputs to file. CANNOT BE USED WITH -n.\n\