diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
commit | fa2f3ac593a792c32095c2e885665ec91bb4019d (patch) | |
tree | f44aee845f0229dfcc6b2ad3c74613e0352f36c2 /src/resources/itemdb.cpp | |
parent | 07f7d52f661a74e6d0c780ca53e724651e3dcc48 (diff) | |
parent | 40edf4e91558cffd83d9015a2cf4a16360e27855 (diff) | |
download | mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.gz mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.bz2 mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.xz mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.zip |
Merged with Aethyra master as of 2009-02-09
Conflicts:
A lot of files...
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 773febd7..9976f0d4 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -24,13 +24,12 @@ #include <libxml/tree.h> #include "itemdb.h" -#include "iteminfo.h" -#include "resourcemanager.h" #include "../log.h" #include "../utils/dtor.h" #include "../utils/gettext.h" +#include "../utils/trim.h" #include "../utils/xml.h" namespace @@ -83,7 +82,7 @@ void ItemDB::load() logger->log(_("ItemDB: Redefinition of item ID %d"), id); } - int type = XML::getProperty(node, "type", 0); + std::string type = XML::getProperty(node, "type", "other"); int weight = XML::getProperty(node, "weight", 0); int view = XML::getProperty(node, "view", 0); @@ -125,14 +124,7 @@ void ItemDB::load() if (itr == mNamedItemInfos.end()) { std::string temp = name; - while (temp[0] == ' ') - { - temp = temp.substr(1, temp.size()); - } - while (temp[temp.size()] == ' ') - { - temp = temp.substr(0, temp.size() - 1); - } + trim(temp); for (unsigned int i = 0; i < temp.size(); i++) { @@ -158,7 +150,7 @@ void ItemDB::load() CHECK_PARAM(description, ""); // CHECK_PARAM(effect, ""); // CHECK_PARAM(type, 0); - CHECK_PARAM(weight, 0); + // CHECK_PARAM(weight, 0); // CHECK_PARAM(slot, 0); #undef CHECK_PARAM |