diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 3dde57785..3a1add737 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -378,8 +378,7 @@ parse_calendar(xmlDocPtr doc) xpathCalendars = xmlXPathEvalExpression(BAD_CAST "/eressea/calendar", xpath); nsetCalendars = xpathCalendars->nodesetval; if (nsetCalendars==NULL || nsetCalendars->nodeNr!=1) { - log_error(("invalid or missing calendar data in %s\n", doc->name)); - rv = -1; + /* rv = -1; */ } else { xmlNodePtr calendar = nsetCalendars->nodeTab[0]; xmlXPathObjectPtr xpathWeeks, xpathMonths, xpathSeasons; @@ -1650,6 +1649,7 @@ parse_races(xmlDocPtr doc) /* reading eressea/races/race/skill */ xpath->node = node; result = xmlXPathEvalExpression(BAD_CAST "skill", xpath); + memset(rc->bonus, 0, sizeof(rc->bonus)); for (k=0;k!=result->nodesetval->nodeNr;++k) { xmlNodePtr node = result->nodesetval->nodeTab[k]; int mod = xml_ivalue(node, "modifier", 0); diff --git a/src/common/util/xml.c b/src/common/util/xml.c index 3be21c622..05c35b8ba 100644 --- a/src/common/util/xml.c +++ b/src/common/util/xml.c @@ -124,7 +124,9 @@ read_xml(const char * filename) while (reader!=NULL) { int i = reader->callback(doc); - if (i!=0) return i; + if (i!=0) { + return i; + } reader = reader->next; } xmlFreeDoc(doc); diff --git a/src/eressea/tolua/bindings.c b/src/eressea/tolua/bindings.c index 6897dbd4d..49a690d62 100644 --- a/src/eressea/tolua/bindings.c +++ b/src/eressea/tolua/bindings.c @@ -906,6 +906,15 @@ static int tolua_get_spells(lua_State* L) lua_pushnil(L); return 1; } + +int +tolua_read_xml(lua_State* L) +{ + const char * filename = tolua_tostring(L, 1, 0); + read_xml(filename); + return 0; +} + int tolua_eressea_open(lua_State* L) { @@ -1023,6 +1032,9 @@ tolua_eressea_open(lua_State* L) tolua_function(L, TOLUA_CAST "spells", tolua_get_spells); tolua_function(L, TOLUA_CAST "write_spells", tolua_write_spells); + + tolua_function(L, TOLUA_CAST "read_xml", tolua_read_xml); + } tolua_endmodule(L); return 1; diff --git a/src/res/e3a-update.xml b/src/res/e3a-update.xml new file mode 100644 index 000000000..d7ead5147 --- /dev/null +++ b/src/res/e3a-update.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/res/races/goblin-e3a.xml b/src/res/races/goblin-e3a.xml new file mode 100644 index 000000000..845b69c20 --- /dev/null +++ b/src/res/races/goblin-e3a.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +