forked from github/server
do not silently fail on unknown skill
This commit is contained in:
parent
b0f1445d68
commit
53aec0d438
1 changed files with 5 additions and 6 deletions
|
@ -1271,13 +1271,12 @@ add_skills(equipment * eq, xmlNodeSetPtr nsetSkills)
|
||||||
propValue = xmlGetProp(node, BAD_CAST "name");
|
propValue = xmlGetProp(node, BAD_CAST "name");
|
||||||
assert(propValue!=NULL);
|
assert(propValue!=NULL);
|
||||||
sk = sk_find((const char*)propValue);
|
sk = sk_find((const char*)propValue);
|
||||||
|
assert(sk!=NOSKILL);
|
||||||
xmlFree(propValue);
|
xmlFree(propValue);
|
||||||
if (sk!=NOSKILL) {
|
propValue = xmlGetProp(node, BAD_CAST "level");
|
||||||
propValue = xmlGetProp(node, BAD_CAST "level");
|
if (propValue!=NULL) {
|
||||||
if (propValue!=NULL) {
|
equipment_setskill(eq, sk, (const char*)propValue);
|
||||||
equipment_setskill(eq, sk, (const char*)propValue);
|
xmlFree(propValue);
|
||||||
xmlFree(propValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue