Do not assert on unknown skills, but log them as an error.

This commit is contained in:
Enno Rehling 2011-03-06 19:56:20 -08:00
parent d75ee1a057
commit 3677e899af
1 changed files with 9 additions and 5 deletions

View File

@ -1271,7 +1271,10 @@ add_skills(equipment * eq, xmlNodeSetPtr nsetSkills)
propValue = xmlGetProp(node, BAD_CAST "name");
assert(propValue!=NULL);
sk = sk_find((const char*)propValue);
assert(sk!=NOSKILL);
if (sk==NOSKILL) {
log_error(("unknown skill '%s' in equipment-set %s\n", (const char*)propValue, eq->name));
xmlFree(propValue);
} else {
xmlFree(propValue);
propValue = xmlGetProp(node, BAD_CAST "level");
if (propValue!=NULL) {
@ -1280,6 +1283,7 @@ add_skills(equipment * eq, xmlNodeSetPtr nsetSkills)
}
}
}
}
}
static void