summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 21:38:28 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 21:38:28 +0200
commit18b6856aa416473019bc36ead2c0e9cda3719a44 (patch)
treeb08f3ed09378dd288f3e4605ad9160d901640dc4 /src/resources
parent768f3d93019b262ce6aa9f913aed0f45d5e4c929 (diff)
parent4e18e7619e9a8c909dea3374a2a7aa39befe0c16 (diff)
downloadmana-client-18b6856aa416473019bc36ead2c0e9cda3719a44.tar.gz
mana-client-18b6856aa416473019bc36ead2c0e9cda3719a44.tar.bz2
mana-client-18b6856aa416473019bc36ead2c0e9cda3719a44.tar.xz
mana-client-18b6856aa416473019bc36ead2c0e9cda3719a44.zip
Merge branch '0.0.29'
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemdb.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 62bf0700..b25f754f 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -96,6 +96,12 @@ static WeaponType weaponTypeFromString(const std::string &name, int id = 0)
else return WPNTYPE_NONE;
}
+static std::string normalized(const std::string &name)
+{
+ std::string normalized = name;
+ return toLower(trim(normalized));;
+}
+
void ItemDB::load()
{
if (mLoaded)
@@ -196,8 +202,7 @@ void ItemDB::load()
mItemInfos[id] = itemInfo;
if (!name.empty())
{
- std::string temp = name;
- toLower(trim(temp));
+ std::string temp = normalized(name);
NamedItemInfos::const_iterator itr = mNamedItemInfos.find(temp);
if (itr == mNamedItemInfos.end())
@@ -266,7 +271,7 @@ const ItemInfo &ItemDB::get(const std::string &name)
{
assert(mLoaded);
- NamedItemInfos::const_iterator i = mNamedItemInfos.find(name);
+ NamedItemInfos::const_iterator i = mNamedItemInfos.find(normalized(name));
if (i == mNamedItemInfos.end())
{