do not silently fail on unknown skill

This commit is contained in:
Enno Rehling 2011-03-05 19:34:51 +01:00
parent b0f1445d68
commit 53aec0d438

View file

@ -1271,13 +1271,12 @@ 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);
if (sk!=NOSKILL) {
propValue = xmlGetProp(node, BAD_CAST "level");
if (propValue!=NULL) {
equipment_setskill(eq, sk, (const char*)propValue);
xmlFree(propValue);
}
propValue = xmlGetProp(node, BAD_CAST "level");
if (propValue!=NULL) {
equipment_setskill(eq, sk, (const char*)propValue);
xmlFree(propValue);
}
}
}