diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 5f50abfa0..6a1e6dd64 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1886,74 +1886,78 @@ parse_main(xmlDocPtr doc) int i; xmlChar * property; - xmlNodePtr node = nodes->nodeTab[0]; + if (nodes->nodeNr>0) { + xmlNodePtr node = nodes->nodeTab[0]; - property = xmlGetProp(node, BAD_CAST "welcome"); - if (property!=NULL) { - global.welcomepath = strdup((const char*)property); - xmlFree(property); - } - - global.unitsperalliance = xml_bvalue(node, "unitsperalliance", false); - global.maxunits = xml_ivalue(node, "units", INT_MAX); + property = xmlGetProp(node, BAD_CAST "welcome"); + if (property!=NULL) { + global.welcomepath = strdup((const char*)property); + xmlFree(property); + } - property = xmlGetProp(node, BAD_CAST "name"); - if (property!=NULL) { - global.gamename = strdup((const char*)property); - xmlFree(property); - } + global.unitsperalliance = xml_bvalue(node, "unitsperalliance", false); + global.maxunits = xml_ivalue(node, "units", INT_MAX); - xmlXPathFreeObject(result); + property = xmlGetProp(node, BAD_CAST "name"); + if (property!=NULL) { + global.gamename = strdup((const char*)property); + xmlFree(property); + } - /* reading eressea/game/param */ - xpath->node = node; - result = xmlXPathEvalExpression(BAD_CAST "param", xpath); - nodes = result->nodesetval; - for (i=0;i!=nodes->nodeNr;++i) { - xmlNodePtr node = nodes->nodeTab[i]; - xmlChar * name = xmlGetProp(node, BAD_CAST "name"); - xmlChar * value = xmlGetProp(node, BAD_CAST "value"); + xmlXPathFreeObject(result); - set_param(&global.parameters, (const char*)name, (const char*)value); + /* reading eressea/game/param */ + xpath->node = node; + result = xmlXPathEvalExpression(BAD_CAST "param", xpath); + nodes = result->nodesetval; + for (i=0;i!=nodes->nodeNr;++i) { + xmlNodePtr node = nodes->nodeTab[i]; + xmlChar * name = xmlGetProp(node, BAD_CAST "name"); + xmlChar * value = xmlGetProp(node, BAD_CAST "value"); - xmlFree(name); - xmlFree(value); - } - xmlXPathFreeObject(result); + set_param(&global.parameters, (const char*)name, (const char*)value); - /* reading eressea/game/order */ - result = xmlXPathEvalExpression(BAD_CAST "order", xpath); - nodes = result->nodesetval; - for (i=0;i!=nodes->nodeNr;++i) { - xmlNodePtr node = nodes->nodeTab[i]; - xmlChar * name = xmlGetProp(node, BAD_CAST "name"); - boolean disable = xml_bvalue(node, "disable", false); + xmlFree(name); + xmlFree(value); + } - if (disable) { - int k; - for (k=0;k!=MAXKEYWORDS;++k) { - if (strcmp(keywords[k], (const char*)name)==0) { - global.disabled[k]=1; - break; + xmlXPathFreeObject(result); + + /* reading eressea/game/order */ + result = xmlXPathEvalExpression(BAD_CAST "order", xpath); + nodes = result->nodesetval; + for (i=0;i!=nodes->nodeNr;++i) { + xmlNodePtr node = nodes->nodeTab[i]; + xmlChar * name = xmlGetProp(node, BAD_CAST "name"); + boolean disable = xml_bvalue(node, "disable", false); + + if (disable) { + int k; + for (k=0;k!=MAXKEYWORDS;++k) { + if (strcmp(keywords[k], (const char*)name)==0) { + global.disabled[k]=1; + break; + } + } + if (k==MAXKEYWORDS) { + log_error(("trying to disable unknown comand %s\n", (const char*)name)); } } - if (k==MAXKEYWORDS) { - log_error(("trying to disable unknown comand %s\n", (const char*)name)); - } + xmlFree(name); } - xmlFree(name); - } - xmlXPathFreeObject(result); - /* reading eressea/game/skill */ - result = xmlXPathEvalExpression(BAD_CAST "skill", xpath); - nodes = result->nodesetval; - for (i=0;i!=nodes->nodeNr;++i) { - xmlNodePtr node = nodes->nodeTab[i]; - xmlChar * name = xmlGetProp(node, BAD_CAST "name"); - boolean enable = xml_bvalue(node, "enable", true); - enable_skill((const char*)name, enable); - xmlFree(name); + xmlXPathFreeObject(result); + + /* reading eressea/game/skill */ + result = xmlXPathEvalExpression(BAD_CAST "skill", xpath); + nodes = result->nodesetval; + for (i=0;i!=nodes->nodeNr;++i) { + xmlNodePtr node = nodes->nodeTab[i]; + xmlChar * name = xmlGetProp(node, BAD_CAST "name"); + boolean enable = xml_bvalue(node, "enable", true); + enable_skill((const char*)name, enable); + xmlFree(name); + } } xmlXPathFreeObject(result); diff --git a/src/res/conquest.xml b/src/res/conquest.xml index 9d94b6cd3..27a466f6e 100644 --- a/src/res/conquest.xml +++ b/src/res/conquest.xml @@ -1,14 +1,14 @@ - + Localization - - + + - - - - + + + + Game specific @@ -16,6 +16,6 @@ - - + + diff --git a/src/res/hse-05-01.xml b/src/res/hse-05-01.xml index bda4b8130..936e30b23 100644 --- a/src/res/hse-05-01.xml +++ b/src/res/hse-05-01.xml @@ -12,10 +12,10 @@ - - - - + + + + diff --git a/src/res/tutorial.xml b/src/res/tutorial.xml index 8d87eddad..8d3e77a3e 100644 --- a/src/res/tutorial.xml +++ b/src/res/tutorial.xml @@ -5,7 +5,7 @@ - + @@ -62,27 +62,24 @@ - - - - - + + + + + tutorial@eressea.upb.de tutorial@eressea.upb.de + + Remember to send your orders to tutorial@eressea.upb.de with the subject ERESSEA ORDERS. + Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an tutorial@eressea.upb.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. + ERESSEA BEFEHLE ERESSEA ORDERS - - ARBEITE - - - WORK - - diff --git a/src/res/tutorial/de/strings.xml b/src/res/tutorial/de/strings.xml index 2a375cb59..98688cca4 100644 --- a/src/res/tutorial/de/strings.xml +++ b/src/res/tutorial/de/strings.xml @@ -1,8 +1,5 @@ - - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an tutorial@eressea.upb.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. - Die ersten beiden Züge mußt du abgeben, sonst wird deine Partei sofort wieder gelöscht, um Karteileichen zu vermeiden. diff --git a/src/res/tutorial/en/strings.xml b/src/res/tutorial/en/strings.xml index 64e06e16f..1b9a5df32 100644 --- a/src/res/tutorial/en/strings.xml +++ b/src/res/tutorial/en/strings.xml @@ -1,9 +1,6 @@ report newbie info - - Remember to send your orders to tutorial@eressea.upb.de with the subject ERESSEA ORDERS. - If you fail to send in orders for one of the first two turns, your faction will be erased from the game to reduce the number of zombie players in Eressea. diff --git a/src/res/vinyambar-3.xml b/src/res/vinyambar-3.xml index 096429e45..08fd2eeba 100644 --- a/src/res/vinyambar-3.xml +++ b/src/res/vinyambar-3.xml @@ -1,14 +1,14 @@ - + Localization - - + + - - - - + + + + Game specific @@ -27,8 +27,8 @@ - - + + vinyambar@eressea.amber.kn-bremen.de diff --git a/src/res/vinyambar-classic.xml b/src/res/vinyambar-classic.xml index 2c6ef71b6..96c3fcbbe 100644 --- a/src/res/vinyambar-classic.xml +++ b/src/res/vinyambar-classic.xml @@ -1,13 +1,13 @@ - + Localization - - + + - - - + + + Game specific @@ -21,8 +21,8 @@ - - + + vinyambar@eressea.amber.kn-bremen.de diff --git a/src/res/vinyambar.xml b/src/res/vinyambar.xml index d133bb251..ce3938ffc 100644 --- a/src/res/vinyambar.xml +++ b/src/res/vinyambar.xml @@ -1,13 +1,13 @@ - + Localization - - + + - - - + + + Game specific @@ -22,8 +22,8 @@ - - + + vinyambar@eressea.amber.kn-bremen.de