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/monsterdb.cpp | |
parent | e50461677bf9f456cb912f5d318a769c3f4724ea (diff) | |
download | mana-client-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.gz mana-client-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.bz2 mana-client-1e6f5283eceff138873ec54159ad8f716ed39b45.tar.xz mana-client-1e6f5283eceff138873ec54159ad8f716ed39b45.zip |
Load the databases at the start of the LOGIN state, after the updates are
loaded.
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r-- | src/resources/monsterdb.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index fb03f6c1..e4406f9c 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -34,11 +34,15 @@ namespace {
MonsterDB::MonsterInfos mMonsterInfos;
MonsterInfo mUnknown;
+ bool mLoaded = false;
}
void
MonsterDB::load()
{
+ if (mLoaded)
+ return;
+
mUnknown.setSprite("error.xml");
mUnknown.setName("unnamed");
@@ -123,6 +127,8 @@ MonsterDB::load() }
mMonsterInfos[XML::getProperty(monsterNode, "id", 0)] = currentInfo;
}
+
+ mLoaded = true;
}
void
@@ -131,6 +137,8 @@ MonsterDB::unload() for_each ( mMonsterInfos.begin(), mMonsterInfos.end(),
make_dtor(mMonsterInfos));
mMonsterInfos.clear();
+
+ mLoaded = false;
}
|