summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2009-10-31 23:52:54 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2009-11-01 00:12:43 +0530
commit67493d93236c231d9a16af420224769cf9daf6e9 (patch)
treef34eb9ffd0108aa5b67765c7a4db0a7298cfc30b /crawl-ref/source/files.cc
parent60ac7168be586603a6bb0afe6e1139cd63993a1d (diff)
downloadcrawl-ref-67493d93236c231d9a16af420224769cf9daf6e9.tar.gz
crawl-ref-67493d93236c231d9a16af420224769cf9daf6e9.zip
loadmaps.lua auto-loads .des files in dat.
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index cb92d19843..30c4fa6e8f 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -503,11 +503,12 @@ std::string canonicalise_file_separator(const std::string &path)
std::string datafile_path(std::string basename,
bool croak_on_fail,
- bool test_base_path)
+ bool test_base_path,
+ bool (*thing_exists)(const std::string&))
{
basename = canonicalise_file_separator(basename);
- if (test_base_path && file_exists(basename))
+ if (test_base_path && thing_exists(basename))
return (basename);
const std::string rawbases[] = {
@@ -562,7 +563,7 @@ std::string datafile_path(std::string basename,
for (unsigned p = 0; p < sizeof(prefixes) / sizeof(*prefixes); ++p)
{
std::string name = bases[b] + prefixes[p] + basename;
- if (file_exists(name))
+ if (thing_exists(name))
return (name);
}