remove pointless <resourcelimit/> wrapper from XML.

This commit is contained in:
Enno Rehling 2017-02-26 14:00:20 +01:00
parent d4b973fea4
commit 6e27adb892
9 changed files with 68 additions and 93 deletions

View file

@ -5,9 +5,7 @@
<item weight="200" score="200">
<construction skill="mining" minskill="8"/>
</item>
<resourcelimit>
<modifier type="require" building="mine"/>
</resourcelimit>
</resource>
<resource name="adamantiumaxe">

View file

@ -3,9 +3,7 @@
<item weight="500" score="10">
<construction skill="mining" minskill="1"/>
</item>
<resourcelimit>
<modifier building="mine" type="skill" value="1"/>
<modifier building="mine" type="material" value="0.5"/>
<modifier race="dwarf" type="material" value="0.60"/>
</resourcelimit>
</resource>

View file

@ -3,7 +3,5 @@
<item weight="200" score="100">
<construction skill="mining" minskill="7"/>
</item>
<resourcelimit>
<modifier type="require" building="mine"/>
</resourcelimit>
</resource>

View file

@ -3,8 +3,6 @@
<item weight="500" score="10">
<construction skill="forestry" minskill="1"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
</resourcelimit>
</resource>

View file

@ -3,8 +3,6 @@
<item weight="500" score="30">
<construction skill="forestry" minskill="2"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
</resourcelimit>
</resource>

View file

@ -3,9 +3,7 @@
<item weight="6000" score="10" big="yes">
<construction skill="quarrying" minskill="1"/>
</item>
<resourcelimit>
<modifier building="quarry" type="skill" value="1"/>
<modifier building="quarry" type="material" value="0.5"/>
<modifier race="troll" type="material" value="0.75"/>
</resourcelimit>
</resource>

View file

@ -3,8 +3,6 @@
<item weight="500" score="10">
<construction skill="mining" minskill="1"/>
</item>
<resourcelimit>
<modifier building="mine" type="skill" value="1"/>
<modifier building="mine" type="material" value="0.5"/>
</resourcelimit>
</resource>

View file

@ -3,8 +3,6 @@
<item weight="6000" score="10" big="yes">
<construction skill="quarrying" minskill="1"/>
</item>
<resourcelimit>
<modifier building="quarry" type="skill" value="1"/>
<modifier building="quarry" type="material" value="0.5"/>
</resourcelimit>
</resource>

View file

@ -983,18 +983,10 @@ static int parse_resources(xmlDocPtr doc)
if (xml_bvalue(node, "limited", false)) {
rtype->flags |= RTF_LIMITED;
}
/* reading eressea/resources/resource/resourcelimit */
/* reading eressea/resources/resource/modifier */
xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "resourcelimit", xpath);
assert(result->nodesetval->nodeNr <= 1);
if (result->nodesetval->nodeNr != 0) {
xmlNodePtr limit = result->nodesetval->nodeTab[0];
xpath->node = limit;
xmlXPathFreeObject(result);
result = xmlXPathEvalExpression(BAD_CAST "modifier", xpath);
if (result->nodesetval != NULL) {
if (result->nodesetval != NULL && result->nodesetval->nodeNr > 0) {
rtype->modifiers =
calloc(result->nodesetval->nodeNr + 1, sizeof(resource_mod));
for (k = 0; k != result->nodesetval->nodeNr; ++k) {
@ -1043,7 +1035,6 @@ static int parse_resources(xmlDocPtr doc)
xmlFree(propValue);
}
}
}
xmlXPathFreeObject(result);
/* reading eressea/resources/resource/resourcelimit/function */
xpath->node = node;