forked from github/server
- herbalism disabled, better
This commit is contained in:
parent
301b9519f0
commit
8480886f14
3 changed files with 24 additions and 4 deletions
|
@ -182,7 +182,11 @@ xml_readconstruction(xmlXPathContextPtr xpath, xmlNodeSetPtr nodeSet, constructi
|
||||||
propValue = xmlGetProp(node, BAD_CAST "skill");
|
propValue = xmlGetProp(node, BAD_CAST "skill");
|
||||||
if (propValue!=NULL) {
|
if (propValue!=NULL) {
|
||||||
sk = sk_find((const char*)propValue);
|
sk = sk_find((const char*)propValue);
|
||||||
assert(sk!=NOSKILL);
|
if (sk==NOSKILL) {
|
||||||
|
log_error(("construction requires skill '%s' that does not exist.", (const char *)propValue));
|
||||||
|
xmlFree(propValue);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
xmlFree(propValue);
|
xmlFree(propValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,8 @@
|
||||||
<skill name="training" enable="true"/>
|
<skill name="training" enable="true"/>
|
||||||
<skill name="unarmed" enable="true"/>
|
<skill name="unarmed" enable="true"/>
|
||||||
<skill name="weaponsmithing" enable="true"/>
|
<skill name="weaponsmithing" enable="true"/>
|
||||||
<skill name="herbalism" enable="true"/>
|
|
||||||
|
<skill name="herbalism" enable="false"/>
|
||||||
|
|
||||||
<skill name="alchemy" enable="false"/>
|
<skill name="alchemy" enable="false"/>
|
||||||
<skill name="entertainment" enable="false"/>
|
<skill name="entertainment" enable="false"/>
|
||||||
|
|
|
@ -371,6 +371,19 @@ function test_market()
|
||||||
assert(len>1)
|
assert(len>1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_herbalism()
|
||||||
|
free_game()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local f = faction.create("enno@eressea.de", "human", "de")
|
||||||
|
f.id = 42
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
u:add_item("money", u.number * 100)
|
||||||
|
u:set_skill("herbalism", 5)
|
||||||
|
u:clear_orders()
|
||||||
|
u:add_order("MACHE Samen")
|
||||||
|
process_orders()
|
||||||
|
end
|
||||||
|
|
||||||
function test_storage()
|
function test_storage()
|
||||||
free_game()
|
free_game()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
|
@ -412,10 +425,12 @@ tests = {
|
||||||
["rename"] = test_rename,
|
["rename"] = test_rename,
|
||||||
["recruit"] = test_recruit,
|
["recruit"] = test_recruit,
|
||||||
["spells"] = test_spells,
|
["spells"] = test_spells,
|
||||||
["storage"] = test_storage
|
["herbalism"] = test_herbalism,
|
||||||
|
["storage"] = test_storage,
|
||||||
|
["market"] = test_market
|
||||||
}
|
}
|
||||||
mytests = {
|
mytests = {
|
||||||
["market"] = test_market
|
["herbalism"] = test_herbalism
|
||||||
}
|
}
|
||||||
fail = 0
|
fail = 0
|
||||||
for k, v in pairs(mytests) do
|
for k, v in pairs(mytests) do
|
||||||
|
|
Loading…
Reference in a new issue