summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2006-02-19 01:23:11 +0000
committerYohann Ferreira <bertram@cegetel.net>2006-02-19 01:23:11 +0000
commit490437151e1a766fcfa9a8df2d5c9132bbfdbcd1 (patch)
treeb382ad39929efbb2f6ed2c0f1d7eee6dfd9bbb0f
parent40eb9159a5b3a776ce844e9522fd0d379a3ff0c4 (diff)
downloadmana-client-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.gz
mana-client-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.bz2
mana-client-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.xz
mana-client-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.zip
Added warnings when parameters are missing in the items xml file.
-rw-r--r--ChangeLog5
-rw-r--r--src/resources/itemmanager.cpp51
2 files changed, 53 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 70020b1a..9fa827d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-05 Yohann Ferreira <bertram@cegetel.net>
+
+ * src/resources/itemmanager.cpp: Added warnings when parameters are
+ missing in the items xml file.
+
2006-02-16 Björn Steinbrink <B.Steinbrink@gmx.de>
* src/gui/browserbox.cpp, src/gui/browserbox.h, src/gui/gui.cpp: Use
diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp
index 507185fc..59767e8e 100644
--- a/src/resources/itemmanager.cpp
+++ b/src/resources/itemmanager.cpp
@@ -36,7 +36,7 @@ ItemManager::ItemManager()
char *data = (char*)resman->loadFile("items.xml", size);
if (!data) {
- logger->error("Could not find items.xml!");
+ logger->error("Item Manager: Could not find items.xml!");
}
xmlDocPtr doc = xmlParseMemory(data, size);
@@ -48,7 +48,7 @@ ItemManager::ItemManager()
if (!node || !xmlStrEqual(node->name, BAD_CAST "items"))
{
- logger->error("items.xml is not a valid database file!");
+ logger->error("Item Manager: items.xml is not a valid database file!");
}
else
{
@@ -111,6 +111,51 @@ ItemManager::ItemManager()
db[id] = itemInfo;
}
+ if (id == 0)
+ {
+ logger->log("Item Manager: An item has no ID in items.xml!");
+ }
+ if (name == "")
+ {
+ logger->log("Item Manager: An item has no name in items.xml!");
+ }
+
+ if (image == 0)
+ {
+ logger->log("Item Manager: Missing image parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (art == 0)
+ {
+ logger->log("Item Manager: Missing art parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (description == "")
+ {
+ logger->log("Item Manager: Missing description parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (effect == "")
+ {
+ logger->log("Item Manager: Missing effect parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (type == 0)
+ {
+ logger->log("Item Manager: Missing type parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (weight == 0)
+ {
+ logger->log("Item Manager: Missing weight parameter for item: %i. %s",
+ id, name.c_str());
+ }
+ if (slot == 0)
+ {
+ logger->log("Item Manager: Missing image parameter for item: %i. %s",
+ id, name.c_str());
+ }
+
/*logger->log("Item: %i %i %i %s %s %i %i %i", id,
getImage(id), getArt(id), getName(id).c_str(),
getDescription(id).c_str(), getType(id), getWeight(id),
@@ -122,7 +167,7 @@ ItemManager::ItemManager()
xmlFreeDoc(doc);
}
else {
- logger->error("Error while parsing item database (items.xml)!");
+ logger->error("Item Manager: Error while parsing item database (items.xml)!");
}
unknown = new ItemInfo();