diff --git a/res/eressea/races.xml b/res/eressea/races.xml index 3ece1b325..04f621526 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -1172,7 +1172,7 @@ - + diff --git a/res/races/orc.xml b/res/races/orc.xml index 4f4d96ed5..a0033759a 100644 --- a/res/races/orc.xml +++ b/res/races/orc.xml @@ -1,5 +1,5 @@ - + diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index a9d38798a..2ef54b005 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -1320,6 +1320,12 @@ static void parse_ai(race * rc, xmlNodePtr node) rc->flags |= RCF_ATTACK_MOVED; } +static void set_study_speed(race *rc, skill_t sk, int modifier){ + if (!rc->study_speed) + rc->study_speed = calloc(1, MAXSKILLS); + rc->study_speed[sk] = (char)modifier; +} + static int parse_races(xmlDocPtr doc) { xmlXPathContextPtr xpath = xmlXPathNewContext(doc); @@ -1338,6 +1344,7 @@ static int parse_races(xmlDocPtr doc) xmlXPathObjectPtr result; int k, study_speed_base, attacks; struct att *attack; + skill_t sk; propValue = xmlGetProp(node, BAD_CAST "name"); assert(propValue != NULL); @@ -1362,6 +1369,11 @@ static int parse_races(xmlDocPtr doc) rc->hitpoints = xml_ivalue(node, "hp", rc->hitpoints); rc->armor = (char)xml_ivalue(node, "ac", rc->armor); study_speed_base = xml_ivalue(node, "studyspeed", 0); + if (study_speed_base != 0) { + for (sk = 0; sk < MAXSKILLS; ++sk) { + set_study_speed(rc, sk, study_speed_base); + } + } rc->at_default = (char)xml_ivalue(node, "unarmedattack", -2); rc->df_default = (char)xml_ivalue(node, "unarmeddefense", -2); @@ -1471,7 +1483,6 @@ static int parse_races(xmlDocPtr doc) xmlNodePtr node = result->nodesetval->nodeTab[k]; int mod = xml_ivalue(node, "modifier", 0); int speed = xml_ivalue(node, "speed", study_speed_base); - skill_t sk; propValue = xmlGetProp(node, BAD_CAST "name"); assert(propValue != NULL); @@ -1479,9 +1490,7 @@ static int parse_races(xmlDocPtr doc) if (sk != NOSKILL) { rc->bonus[sk] = (char)mod; if (speed) { - if (!rc->study_speed) - rc->study_speed = calloc(1, MAXSKILLS); - rc->study_speed[sk] = (char)speed; + set_study_speed(rc, sk, speed); } } else {