forked from github/server
Do not assert on unknown skills, but log them as an error.
This commit is contained in:
parent
d75ee1a057
commit
3677e899af
1 changed files with 9 additions and 5 deletions
|
@ -1271,12 +1271,16 @@ add_skills(equipment * eq, xmlNodeSetPtr nsetSkills)
|
|||
propValue = xmlGetProp(node, BAD_CAST "name");
|
||||
assert(propValue!=NULL);
|
||||
sk = sk_find((const char*)propValue);
|
||||
assert(sk!=NOSKILL);
|
||||
xmlFree(propValue);
|
||||
propValue = xmlGetProp(node, BAD_CAST "level");
|
||||
if (propValue!=NULL) {
|
||||
equipment_setskill(eq, sk, (const char*)propValue);
|
||||
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) {
|
||||
equipment_setskill(eq, sk, (const char*)propValue);
|
||||
xmlFree(propValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue