diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-12-23 18:01:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-12-23 18:01:01 +0000 |
commit | 1e6f5283eceff138873ec54159ad8f716ed39b45 (patch) | |
tree | 94b13a2ffa13a8980af177f38dd82a0b8d778d8b /src/resources/itemdb.cpp | |
parent | e50461677bf9f456cb912f5d318a769c3f4724ea (diff) | |
download | mana-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.gz mana-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.bz2 mana-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.xz mana-1e6f5283eceff138873ec54159ad8f716ed39b45.zip |
Load the databases at the start of the LOGIN state, after the updates are
loaded.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index b91e34cc..f914af47 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -37,11 +37,15 @@ namespace {
ItemDB::ItemInfos mItemInfos;
ItemInfo mUnknown;
+ bool mLoaded = false;
}
void ItemDB::load()
{
+ if (mLoaded)
+ return;
+
logger->log("Initializing item database...");
mUnknown.setName("Unknown item");
@@ -150,6 +154,8 @@ void ItemDB::load() }
xmlFreeDoc(doc);
+
+ mLoaded = true;
}
void ItemDB::unload()
@@ -159,6 +165,8 @@ void ItemDB::unload() delete i->second;
}
mItemInfos.clear();
+
+ mLoaded = false;
}
const ItemInfo&
|