summaryrefslogtreecommitdiff
path: root/src/resources/itemmanager.cpp
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 /src/resources/itemmanager.cpp
parent40eb9159a5b3a776ce844e9522fd0d379a3ff0c4 (diff)
downloadmana-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.gz
mana-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.bz2
mana-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.tar.xz
mana-490437151e1a766fcfa9a8df2d5c9132bbfdbcd1.zip
Added warnings when parameters are missing in the items xml file.
Diffstat (limited to 'src/resources/itemmanager.cpp')
-rw-r--r--src/resources/itemmanager.cpp51
1 files changed, 48 insertions, 3 deletions
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();