added some safety checks for -m
This commit is contained in:
@ -53,6 +53,9 @@ feature proc_args(int argc, char **argv,
|
|||||||
FEATURE_INVENTORY |
|
FEATURE_INVENTORY |
|
||||||
FEATURE_WALK_OVER;
|
FEATURE_WALK_OVER;
|
||||||
} else if (str == "-R") {
|
} else if (str == "-R") {
|
||||||
|
if (result & FEATURE_READ_MAP)
|
||||||
|
return FEATURE_CONFLICT | i;
|
||||||
|
|
||||||
result |= FEATURE_REVISIT;
|
result |= FEATURE_REVISIT;
|
||||||
} else if (str == "-e") {
|
} else if (str == "-e") {
|
||||||
result |= FEATURE_EXTRA_STUFF;
|
result |= FEATURE_EXTRA_STUFF;
|
||||||
@ -61,7 +64,9 @@ feature proc_args(int argc, char **argv,
|
|||||||
} else if (str == "-o") {
|
} else if (str == "-o") {
|
||||||
result |= FEATURE_WALK_OVER;
|
result |= FEATURE_WALK_OVER;
|
||||||
} else if (str == "-m") {
|
} 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;
|
return FEATURE_CONFLICT | i;
|
||||||
|
|
||||||
result |= FEATURE_READ_MAP;
|
result |= FEATURE_READ_MAP;
|
||||||
@ -185,16 +190,16 @@ void panic_args(feature panic) {
|
|||||||
|
|
||||||
const char *ARGS_LIST = "\
|
const char *ARGS_LIST = "\
|
||||||
-n : Use ncurses for I/O\n\
|
-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\
|
-c : Enemies chase the player (CAUTION: THEY CAN REALLY CHASE!!!)\n\
|
||||||
-d : Enemies can go through doors (CAUTION: DO NOT ENABLE WITH CHASING!)\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\
|
-i : Enable inventory (player can pick up potions, will turn on -o)\n\
|
||||||
-t : Enable throw (will turn on -i)\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 potions and races\n\
|
||||||
-E : Enable extra levels\n\
|
-E : Enable extra levels\n\
|
||||||
-o : Allows characters to go over gold and potions\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\
|
-s [seed] : Sets initial seed to seed\n\
|
||||||
-I [file] : Reads commands from file. CANNOT BE USED WITH -n.\n\
|
-I [file] : Reads commands from file. CANNOT BE USED WITH -n.\n\
|
||||||
-O [file] : Outputs to file. CANNOT BE USED WITH -n.\n\
|
-O [file] : Outputs to file. CANNOT BE USED WITH -n.\n\
|
||||||
|
Reference in New Issue
Block a user