eliminate game/order from XML data

This commit is contained in:
Enno Rehling 2015-09-12 17:12:02 +02:00
parent 44eb3a4f58
commit c76b118fb8
7 changed files with 23 additions and 41 deletions

View File

@ -54,10 +54,6 @@
<xi:include href="config://default/names-dragons.xml"/>
<game>
<!-- Game specific settings -->
<order name="pay" disable="yes"/>
<skill name="alchemy" enable="true"/>
<skill name="crossbow" enable="true"/>
<skill name="mining" enable="true"/>

View File

@ -4,6 +4,17 @@
"prefixes.json",
"e3/terrains.json"
],
"disable": [
"besiege",
"steal",
"buy",
"teach",
"sabotage",
"spy",
"tax",
"entertain",
"sell"
],
"settings": {
"game.id": 3,
"game.name": "E3",

View File

@ -43,17 +43,6 @@
<xi:include href="config://default/names-dragons.xml"/>
<game>
<!-- Game specific settings -->
<order name="besiege" disable="yes"/>
<order name="steal" disable="yes"/>
<order name="buy" disable="yes"/>
<order name="teach" disable="yes"/>
<order name="sabotage" disable="yes"/>
<order name="spy" disable="yes"/>
<order name="tax" disable="yes"/>
<order name="entertain" disable="yes"/>
<order name="sell" disable="yes"/>
<skill name="armorer" enable="true"/>
<skill name="bow" enable="true"/>
<skill name="building" enable="true"/>

View File

@ -4,6 +4,17 @@
"prefixes.json",
"e3/terrains.json"
],
"disable": [
"besiege",
"steal",
"buy",
"teach",
"sabotage",
"spy",
"tax",
"entertain",
"sell"
],
"settings": {
"game.id": 4,
"game.name": "Deveron",

View File

@ -43,16 +43,6 @@
<xi:include href="config://default/names-dragons.xml"/>
<game>
<order name="besiege" disable="yes"/>
<order name="steal" disable="yes"/>
<order name="buy" disable="yes"/>
<order name="teach" disable="yes"/>
<order name="sabotage" disable="yes"/>
<order name="spy" disable="yes"/>
<order name="tax" disable="yes"/>
<order name="entertain" disable="yes"/>
<order name="sell" disable="yes"/>
<skill name="armorer" enable="true"/>
<skill name="bow" enable="true"/>
<skill name="building" enable="true"/>

View File

@ -504,7 +504,7 @@ static void json_prefixes(cJSON *json) {
static void json_disable_keywords(cJSON *json) {
cJSON *child;
if (json->type != cJSON_Array) {
log_error("disabled is not a json array: %d", json->type);
log_error("disable is not a json array: %d", json->type);
return;
}
for (child = json->child; child; child = child->next) {

View File

@ -2066,21 +2066,6 @@ static int parse_main(xmlDocPtr doc)
xmlXPathFreeObject(result);
xpath->node = node;
/* 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 *propName = xmlGetProp(node, BAD_CAST "name");
if (xml_bvalue(node, "disable", false)) {
disable_keyword_str((const char *)propName);
}
xmlFree(propName);
}
xmlXPathFreeObject(result);
/* reading eressea/game/skill */
result = xmlXPathEvalExpression(BAD_CAST "skill", xpath);
nodes = result->nodesetval;