summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-17 20:21:06 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-03-17 23:44:36 +0100
commit2a0e90942f926a11da975c681999c0a5ac443bc9 (patch)
tree13940fa2ec96e2fdaec5c84393cad56696ce2153 /crawl-ref/source/database.cc
parent01e5bbb2baa8041ad7220ce486a95ff5c350912e (diff)
downloadcrawl-ref-2a0e90942f926a11da975c681999c0a5ac443bc9.tar.gz
crawl-ref-2a0e90942f926a11da975c681999c0a5ac443bc9.zip
Fix database[en] being rebuilt every time if database[X] exists and is enabled.
Diffstat (limited to 'crawl-ref/source/database.cc')
-rw-r--r--crawl-ref/source/database.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc
index 74d04bf8bc..7f3a231d9d 100644
--- a/crawl-ref/source/database.cc
+++ b/crawl-ref/source/database.cc
@@ -66,7 +66,8 @@ public:
static void _store_text_db(const std::string &in, DBM *db);
static std::string _query_database(TextDB &db, std::string key,
- bool canonicalise_key, bool run_lua);
+ bool canonicalise_key, bool run_lua,
+ bool untranslated = false);
static void _add_entry(DBM *db, const std::string &k, std::string &v);
static TextDB AllDBs[] =
@@ -191,7 +192,7 @@ bool TextDB::open_db()
if (!_db)
return false;
- timestamp = _query_database(*this, "TIMESTAMP", false, false);
+ timestamp = _query_database(*this, "TIMESTAMP", false, false, true);
if (timestamp.empty())
return false;
@@ -712,7 +713,8 @@ static void _call_recursive_replacement(std::string &str, DBM *database,
}
static std::string _query_database(TextDB &db, std::string key,
- bool canonicalise_key, bool run_lua)
+ bool canonicalise_key, bool run_lua,
+ bool untranslated)
{
if (canonicalise_key)
{
@@ -724,7 +726,7 @@ static std::string _query_database(TextDB &db, std::string key,
// Query the DB.
datum result;
- if (db.translation)
+ if (db.translation && !untranslated)
result = _database_fetch(db.translation->get(), key);
if (!result.dptr)
result = _database_fetch(db.get(), key);