summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authornlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 02:54:00 +0000
committernlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 02:54:00 +0000
commita77e1d86ee4ce3d49c49750bee70a0fabfcf17a1 (patch)
tree55cee88cde1418572250c3cabfc3c65201020156 /crawl-ref/source
parent1453a4ca617432ab205dc73cde03586baad49259 (diff)
downloadcrawl-ref-a77e1d86ee4ce3d49c49750bee70a0fabfcf17a1.tar.gz
crawl-ref-a77e1d86ee4ce3d49c49750bee70a0fabfcf17a1.zip
FR 2533562: Move the CRAWL_PIZZA / -pizza options into the init file
so that they're more easily accessible in hosted games. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9250 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/externs.h2
-rw-r--r--crawl-ref/source/food.cc4
-rw-r--r--crawl-ref/source/initfile.cc25
-rw-r--r--crawl-ref/source/initfile.h1
5 files changed, 14 insertions, 21 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index f46e4c33ec..0d75164a24 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -294,7 +294,6 @@ static void _show_commandline_options_help()
puts(" -name <string> character name");
puts(" -race <arg> preselect race (by letter, abbreviation, or name)");
puts(" -class <arg> preselect class (by letter, abbreviation, or name)");
- puts(" -pizza <string> crawl pizza");
puts(" -plain don't use IBM extended characters");
puts(" -dir <path> crawl directory");
puts(" -rc <file> init file name");
@@ -303,7 +302,7 @@ static void _show_commandline_options_help()
puts(" -macro <dir> directory to save/find macro.txt");
puts("");
puts("Command line options override init file options, which override");
- puts("environment options (CRAWL_NAME, CRAWL_PIZZA, CRAWL_DIR, CRAWL_RC).");
+ puts("environment options (CRAWL_NAME, CRAWL_DIR, CRAWL_RC).");
puts("");
puts("Highscore list options: (Can now be redirected to more, etc)");
puts(" -scores [N] highscore list");
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index cd33b5565b..4b70506ba3 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -2022,6 +2022,8 @@ public:
int num_colours; // used for setting up curses colour table (8 or 16)
+ std::string pizza;
+
#ifdef WIZARD
int wiz_mode; // yes, no, never in wiz mode to start
#endif
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index adaffcb250..10ad22a7e7 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -2097,8 +2097,8 @@ void finished_eating_message(int food_type)
restore_stat(STAT_ALL, 0, false);
break;
case FOOD_PIZZA:
- if (!SysEnv.crawl_pizza.empty() && !one_chance_in(3))
- mprf("Mmm... %s.", SysEnv.crawl_pizza.c_str());
+ if (!Options.pizza.empty() && !one_chance_in(3))
+ mprf("Mmm... %s.", Options.pizza.c_str());
else
{
int temp_rand;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 671264c652..d4d5f1d25f 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -855,7 +855,9 @@ void game_options::reset_options()
false);
item_stack_summary_minimum = 5;
-
+
+ pizza.clear();
+
#ifdef WIZARD
fsim_rounds = 40000L;
fsim_mons = "worm";
@@ -2291,6 +2293,11 @@ void game_options::read_option_line(const std::string &str, bool runscript)
{
set_fire_order(field, plus_equal);
}
+ else if (key == "pizza")
+ {
+ // field is already cleaned up from trim_string()
+ pizza = field;
+ }
BOOL_OPTION(random_pick);
else BOOL_OPTION(good_random);
@@ -3313,9 +3320,6 @@ void get_system_environment(void)
// The player's name
SysEnv.crawl_name = check_string( getenv("CRAWL_NAME") );
- // The player's pizza
- SysEnv.crawl_pizza = check_string( getenv("CRAWL_PIZZA") );
-
// The directory which contians init.txt, macro.txt, morgue.txt
// This should end with the appropriate path delimiter.
SysEnv.crawl_dir = check_string( getenv("CRAWL_DIR") );
@@ -3359,7 +3363,6 @@ enum commandline_option_type {
CLO_NAME,
CLO_RACE,
CLO_CLASS,
- CLO_PIZZA,
CLO_PLAIN,
CLO_DIR,
CLO_RC,
@@ -3376,7 +3379,7 @@ enum commandline_option_type {
};
static const char *cmd_ops[] = {
- "scores", "name", "race", "class", "pizza", "plain", "dir", "rc",
+ "scores", "name", "race", "class", "plain", "dir", "rc",
"rcdir", "tscores", "vscores", "scorefile", "morgue", "macro",
"mapstat", "arena"
};
@@ -3569,16 +3572,6 @@ bool parse_args( int argc, char **argv, bool rc_only )
nextUsed = true;
break;
- case CLO_PIZZA:
- if (!next_is_param)
- return (false);
-
- if (!rc_only)
- SysEnv.crawl_pizza = next_arg;
-
- nextUsed = true;
- break;
-
case CLO_PLAIN:
if (next_is_param)
return (false);
diff --git a/crawl-ref/source/initfile.h b/crawl-ref/source/initfile.h
index 471eba7387..1d7d40f2ff 100644
--- a/crawl-ref/source/initfile.h
+++ b/crawl-ref/source/initfile.h
@@ -51,7 +51,6 @@ struct system_environment
{
public:
std::string crawl_name;
- std::string crawl_pizza;
std::string crawl_rc;
std::string crawl_dir;