From 5a823500379f8e6c9e45b96b3437d7b4603350a0 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 12 Jun 2014 22:30:13 -0700 Subject: [PATCH] fix broken xmlreader after most recent cahnges to race/ship_type/building_type creation functions. --- src/kernel/xmlreader.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index 3ccc2cb3b..e2d5bd9c1 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -617,7 +617,7 @@ static void race_compat(void) if (rcname == NULL) { new_race[i] = NULL; } else { - race *rc = rc_find(oldracenames[i]); + race *rc = rc_get_or_create(oldracenames[i]); if (rc) { new_race[i] = rc; if (rc == new_race[RC_TROLL]) { @@ -772,7 +772,7 @@ static weapon_type *xml_readweapon(xmlXPathContextPtr xpath, item_type * itype) if (propValue != NULL) { const race *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); racelist_insert(&wtype->modifiers[k].races, rc); xmlFree(propValue); } @@ -1690,9 +1690,7 @@ static int parse_races(xmlDocPtr doc) propValue = xmlGetProp(node, BAD_CAST "name"); 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); propValue = xmlGetProp(node, BAD_CAST "damage"); @@ -1880,10 +1878,7 @@ static int parse_races(xmlDocPtr doc) propValue = xmlGetProp(node, BAD_CAST "race"); 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)) { rc->familiars[k] = rc->familiars[0]; rc->familiars[0] = frc;