forked from github/server
bug 2069: not all E3 magic schools have a familiar.
https://bugs.eressea.de/view.php?id=2069 quick fix: defaulting all additional schools to the illaun familiar.
This commit is contained in:
parent
258f3c37c0
commit
414f6d3210
|
@ -158,6 +158,7 @@ static race *rc_find_i(const char *name)
|
|||
}
|
||||
if (!rc && strcmp(name, "uruk") == 0) {
|
||||
rc = rc_find_i("orc");
|
||||
log_warning("a reference was made to the retired race '%s', returning '%s'.", name, rc->_name);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,6 @@ extern "C" {
|
|||
int flags;
|
||||
int battle_flags;
|
||||
int ec_flags;
|
||||
race_t oldfamiliars[MAXMAGIETYP];
|
||||
struct att attack[RACE_ATTACKS];
|
||||
signed char bonus[MAXSKILLS];
|
||||
|
||||
|
|
|
@ -1613,7 +1613,7 @@ static int parse_races(xmlDocPtr doc)
|
|||
xmlNodePtr node = nodes->nodeTab[i];
|
||||
xmlNodePtr child;
|
||||
xmlChar *propValue;
|
||||
race *rc;
|
||||
race *rc, *frc = 0;
|
||||
xmlXPathObjectPtr result;
|
||||
int k, study_speed_base, attacks;
|
||||
struct att *attack;
|
||||
|
@ -1810,21 +1810,27 @@ static int parse_races(xmlDocPtr doc)
|
|||
/* reading eressea/races/race/familiar */
|
||||
xpath->node = node;
|
||||
result = xmlXPathEvalExpression(BAD_CAST "familiar", xpath);
|
||||
for (k = 0; k != result->nodesetval->nodeNr; ++k) {
|
||||
xmlNodePtr node = result->nodesetval->nodeTab[k];
|
||||
race *frc;
|
||||
if (result->nodesetval->nodeNr > MAXMAGIETYP) {
|
||||
log_error("race %s has %d potential familiars", rc->_name, result->nodesetval->nodeNr);
|
||||
}
|
||||
for (k = 0; k != MAXMAGIETYP; ++k) {
|
||||
if (k < result->nodesetval->nodeNr) {
|
||||
xmlNodePtr node = result->nodesetval->nodeTab[k];
|
||||
|
||||
propValue = xmlGetProp(node, BAD_CAST "race");
|
||||
assert(propValue != NULL);
|
||||
frc = rc_get_or_create((const char *)propValue);
|
||||
if (xml_bvalue(node, "default", false)) {
|
||||
rc->familiars[k] = rc->familiars[0];
|
||||
rc->familiars[0] = frc;
|
||||
}
|
||||
else {
|
||||
propValue = xmlGetProp(node, BAD_CAST "race");
|
||||
assert(propValue != NULL);
|
||||
frc = rc_get_or_create((const char *)propValue);
|
||||
if (xml_bvalue(node, "default", false)) {
|
||||
rc->familiars[k] = rc->familiars[0];
|
||||
rc->familiars[0] = frc;
|
||||
}
|
||||
else {
|
||||
rc->familiars[k] = frc;
|
||||
}
|
||||
xmlFree(propValue);
|
||||
} else {
|
||||
rc->familiars[k] = frc;
|
||||
}
|
||||
xmlFree(propValue);
|
||||
}
|
||||
xmlXPathFreeObject(result);
|
||||
|
||||
|
|
|
@ -480,6 +480,7 @@ static const race *select_familiar(const race * magerace, magic_t magiegebiet)
|
|||
assert(magerace->familiars[0]);
|
||||
if (rnd >= 70) {
|
||||
retval = magerace->familiars[magiegebiet];
|
||||
assert(retval);
|
||||
}
|
||||
else {
|
||||
retval = magerace->familiars[0];
|
||||
|
|
Loading…
Reference in New Issue