summaryrefslogtreecommitdiff
path: root/src/resources/monsterdb.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-04 02:20:38 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-04 02:20:38 +0000
commit4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac (patch)
tree0b18ed6970f8fdd6750459e6f9032e444d253580 /src/resources/monsterdb.cpp
parente160ba567bf3d2ae915e67c12c13e213c1a32a62 (diff)
downloadmana-4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac.tar.gz
mana-4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac.tar.bz2
mana-4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac.tar.xz
mana-4eec29ac0f6a9b05562ac0fbe3d4e5d7e82deeac.zip
Merged 0.0 changes from revision 2898 to 2988 to trunk.
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r--src/resources/monsterdb.cpp8
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;
}