Merge branch 'master' of github.com:eressea/server

This commit is contained in:
Enno Rehling 2014-06-13 08:29:01 -07:00
commit 97c17b1afa
1 changed files with 4 additions and 9 deletions

View File

@ -617,7 +617,7 @@ static void race_compat(void)
if (rcname == NULL) { if (rcname == NULL) {
new_race[i] = NULL; new_race[i] = NULL;
} else { } else {
race *rc = rc_find(oldracenames[i]); race *rc = rc_get_or_create(oldracenames[i]);
if (rc) { if (rc) {
new_race[i] = rc; new_race[i] = rc;
if (rc == new_race[RC_TROLL]) { if (rc == new_race[RC_TROLL]) {
@ -772,7 +772,7 @@ static weapon_type *xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
if (propValue != NULL) { if (propValue != NULL) {
const race *rc = rc_find((const char *)propValue); const race *rc = rc_find((const char *)propValue);
if (rc == NULL) if (rc == NULL)
rc = rc_get_or_create((const char *)propValue)); rc = rc_get_or_create((const char *)propValue);
racelist_insert(&wtype->modifiers[k].races, rc); racelist_insert(&wtype->modifiers[k].races, rc);
xmlFree(propValue); xmlFree(propValue);
} }
@ -1690,8 +1690,6 @@ static int parse_races(xmlDocPtr doc)
propValue = xmlGetProp(node, BAD_CAST "name"); propValue = xmlGetProp(node, BAD_CAST "name");
assert(propValue != NULL); assert(propValue != NULL);
rc = rc_find((const char *)propValue);
if (rc == NULL)
rc = rc_get_or_create((const char *)propValue); rc = rc_get_or_create((const char *)propValue);
xmlFree(propValue); xmlFree(propValue);
@ -1880,10 +1878,7 @@ static int parse_races(xmlDocPtr doc)
propValue = xmlGetProp(node, BAD_CAST "race"); propValue = xmlGetProp(node, BAD_CAST "race");
assert(propValue != NULL); assert(propValue != NULL);
frc = rc_find((const char *)propValue);
if (!frc) {
frc = rc_get_or_create((const char *)propValue); frc = rc_get_or_create((const char *)propValue);
}
if (xml_bvalue(node, "default", false)) { if (xml_bvalue(node, "default", false)) {
rc->familiars[k] = rc->familiars[0]; rc->familiars[k] = rc->familiars[0];
rc->familiars[0] = frc; rc->familiars[0] = frc;