summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-24 20:08:10 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-24 20:08:10 +0000
commit6760750eb72b4507db1f7660bab88e013dc3fa94 (patch)
tree9b4b3d500e4facdab61b5b7ed975f69e2067b009 /crawl-ref
parentfa22f87e8ff71520801954ebeebff2e4499709c8 (diff)
downloadcrawl-ref-6760750eb72b4507db1f7660bab88e013dc3fa94.tar.gz
crawl-ref-6760750eb72b4507db1f7660bab88e013dc3fa94.zip
Added DGL_STARTUP_PREFS_BY_NAME to store new character options by username
for dgamelaunch. Dropped ice statue hitpoints to compensate for their immunity to disintegration. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2195 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/AppHdr.h4
-rw-r--r--crawl-ref/source/acr.cc4
-rw-r--r--crawl-ref/source/files.cc5
-rw-r--r--crawl-ref/source/initfile.cc9
-rw-r--r--crawl-ref/source/initfile.h2
-rw-r--r--crawl-ref/source/libutil.cc2
-rw-r--r--crawl-ref/source/mon-data.h2
7 files changed, 19 insertions, 9 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 4aeddb03c1..6a67709cc7 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -217,6 +217,10 @@
//
#define DGL_CLEAR_SCREEN "\033[2J"
+ // Startup preferences are saved by player name rather than uid,
+ // since all players use the same uid in dgamelaunch.
+ #define DGL_STARTUP_PREFS_BY_NAME
+
// Increase the size of the topscores file for public servers.
#define SCORE_FILE_ENTRIES 1000
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 348b0a10d1..2c0801e494 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -224,6 +224,10 @@ int main( int argc, char *argv[] )
// now parse the args again, looking for everything else.
parse_args( argc, argv, false );
+ // read the options the player used last time they created a new
+ // character.
+ read_startup_prefs();
+
if (Options.sc_entries != 0 || !SysEnv.scorefile.empty())
{
hiscores_print_all( Options.sc_entries, Options.sc_format );
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 20a0a93579..b428ea85b1 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -547,7 +547,12 @@ std::string get_savedir_filename(const std::string &prefix,
std::string get_prefs_filename()
{
+#ifdef DGL_STARTUP_PREFS_BY_NAME
+ return get_savedir_filename("start-" + Options.player_name + "-",
+ "ns", "prf", true);
+#else
return get_savedir_filename("start", "ns", "prf");
+#endif
}
static std::string get_level_suffix(int level, branch_type where,
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index f37ac9da9b..5fc1f998ba 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -50,8 +50,6 @@ game_options Options;
const static char *obj_syms = ")([/%.?=!.+\\0}X$";
const static int obj_syms_len = 16;
-static void read_startup_prefs();
-
template<class A, class B> void append_vector(A &dest, const B &src)
{
dest.insert( dest.end(), src.begin(), src.end() );
@@ -1016,14 +1014,11 @@ std::string read_init_file(bool runscript)
}
read_options(f, runscript);
- if (!runscript)
- read_startup_prefs();
-
fclose(f);
return std::string(name_buff);
} // end read_init_file()
-static void read_startup_prefs()
+void read_startup_prefs()
{
#ifndef DISABLE_STICKY_STARTUP_OPTIONS
std::string fn = get_prefs_filename();
@@ -1589,11 +1584,13 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
}
}
+#ifndef DGAMELAUNCH
else if (key == "name")
{
// field is already cleaned up from trim_string()
player_name = field;
}
+#endif
else if (key == "char_set" || key == "ascii_display")
{
bool valid = true;
diff --git a/crawl-ref/source/initfile.h b/crawl-ref/source/initfile.h
index 9877e1bd0c..5536d4bcca 100644
--- a/crawl-ref/source/initfile.h
+++ b/crawl-ref/source/initfile.h
@@ -36,8 +36,8 @@ const char* colour_to_str( unsigned char colour );
* *********************************************************************** */
std::string read_init_file(bool runscript = false);
+void read_startup_prefs();
void read_options(FILE *f, bool runscript = false);
-
void read_options(const std::string &s, bool runscript = false);
void parse_option_line(const std::string &line, bool runscript = false);
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 845f96b380..e2298ecb3a 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -101,7 +101,7 @@ void play_sound( const char *file )
std::string strip_filename_unsafe_chars(const std::string &s)
{
- return replace_all_of(s, " .", "");
+ return replace_all_of(s, " .&`\"\'|;:/\\{}()[]<>*%$#@!~?", "");
}
std::string make_stringf(const char *s, ...)
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 0340f2aaa1..1f92f36078 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -4411,7 +4411,7 @@
MR_RES_POISON | MR_VUL_FIRE | MR_RES_COLD | MR_RES_ELEC,
0, 10, MONS_CLAY_GOLEM, MONS_ICE_STATUE, MH_NONLIVING, MAG_IMMUNE,
{ {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} },
- { 8, 0, 0, 140 },
+ { 8, 0, 0, 70 },
12, 1, 16, 7, MST_ICE_STATUE, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH,
MONUSE_NOTHING, SIZE_LARGE
}