diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/itemdb.cpp | 59 |
1 files changed, 15 insertions, 44 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 6e0ecce9..70ead6ab 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -102,55 +102,26 @@ void ItemDB::load() mItemInfos[id] = itemInfo;
}
-
if (id == 0)
{
logger->log("ItemDB: An item has no ID in items.xml!");
}
- if (name == "")
- {
- logger->log("ItemDB: Missing name for item %d!", id);
- }
- if (image == "")
- {
- logger->log("ItemDB: 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("ItemDB: Missing description parameter for item: %i. %s",
- id, name.c_str());
- }
- if (effect == "")
- {
- logger->log("ItemDB: 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 slot parameter for item: %i. %s",
- id, name.c_str());
- }
- */
+#define CHECK_PARAM(param, error_value) \
+ if (param == error_value) \
+ logger->log("ItemDB: Missing" #param " parameter for item %i! %s", \
+ id, name.c_str())
+
+ CHECK_PARAM(name, "");
+ CHECK_PARAM(image, "");
+ // CHECK_PARAM(art, 0);
+ // CHECK_PARAM(description, "");
+ // CHECK_PARAM(effect, "");
+ // CHECK_PARAM(type, 0);
+ CHECK_PARAM(weight, 0);
+ // CHECK_PARAM(slot, 0);
+
+#undef CHECK_PARAM
}
xmlFreeDoc(doc);
|