diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c
index 92e71a83f..cb3cc956b 100644
--- a/src/common/kernel/xmlreader.c
+++ b/src/common/kernel/xmlreader.c
@@ -182,7 +182,11 @@ xml_readconstruction(xmlXPathContextPtr xpath, xmlNodeSetPtr nodeSet, constructi
propValue = xmlGetProp(node, BAD_CAST "skill");
if (propValue!=NULL) {
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);
}
diff --git a/src/res/e2k9.xml b/src/res/e2k9.xml
index 0374db2d6..f0f044978 100644
--- a/src/res/e2k9.xml
+++ b/src/res/e2k9.xml
@@ -96,7 +96,8 @@
-
+
+
diff --git a/src/scripts/tests.lua b/src/scripts/tests.lua
index c18527bbc..498985a78 100644
--- a/src/scripts/tests.lua
+++ b/src/scripts/tests.lua
@@ -371,6 +371,19 @@ function test_market()
assert(len>1)
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()
free_game()
local r = region.create(0, 0, "plain")
@@ -412,10 +425,12 @@ tests = {
["rename"] = test_rename,
["recruit"] = test_recruit,
["spells"] = test_spells,
- ["storage"] = test_storage
+ ["herbalism"] = test_herbalism,
+ ["storage"] = test_storage,
+ ["market"] = test_market
}
mytests = {
- ["market"] = test_market
+ ["herbalism"] = test_herbalism
}
fail = 0
for k, v in pairs(mytests) do