diff --git a/src/common/kernel/terrain.c b/src/common/kernel/terrain.c index e7f033b15..b8ca731d8 100644 --- a/src/common/kernel/terrain.c +++ b/src/common/kernel/terrain.c @@ -129,7 +129,8 @@ terrain_name(const struct region * r) if (r->attribs) { attrib * a = a_find(r->attribs, &at_racename); if (a) { - return get_racename(a); + const char * str = get_racename(a); + if (str) return str; } } diff --git a/src/eressea.sln b/src/eressea.sln index 01b4c779e..40a868a5c 100644 --- a/src/eressea.sln +++ b/src/eressea.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +# Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}" @@ -19,10 +19,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea", "eressea.vcproj", "{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}" EndProject Global - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Profile|Win32 = Profile|Win32 @@ -59,4 +55,8 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(SubversionScc) = preSolution + Svn-Managed = True + Manager = AnkhSVN - Subversion Support for Visual Studio + EndGlobalSection EndGlobal diff --git a/src/res/e3a/spells.xml b/src/res/e3a/spells.xml index c0ff03a3e..58baf2ead 100644 --- a/src/res/e3a/spells.xml +++ b/src/res/e3a/spells.xml @@ -276,7 +276,7 @@ - + diff --git a/src/scripts/asgard/extensions.lua b/src/scripts/asgard/extensions.lua index 8b219598d..31f81069d 100644 --- a/src/scripts/asgard/extensions.lua +++ b/src/scripts/asgard/extensions.lua @@ -48,9 +48,9 @@ function horse_produce(r, n) end function log_limit(r) - if r:get_flag(1) then -- RF_MALLORN - return 0 - end +-- if r:get_flag(1) then -- RF_MALLORN +-- return 0 +-- end return r:get_resource("tree") + r:get_resource("sapling") end diff --git a/src/scripts/extensions.lua b/src/scripts/extensions.lua index e42a9d759..688fe3d1d 100644 --- a/src/scripts/extensions.lua +++ b/src/scripts/extensions.lua @@ -43,9 +43,9 @@ function horse_produce(r, n) end function log_limit(r) - if r:get_flag(1) then -- RF_MALLORN - return 0 - end +-- if r:get_flag(1) then -- RF_MALLORN +-- return 0 +-- end return r:get_resource("tree") + r:get_resource("sapling") end diff --git a/src/scripts/tests.lua b/src/scripts/tests.lua index 97a4ee851..0890fad2d 100644 --- a/src/scripts/tests.lua +++ b/src/scripts/tests.lua @@ -501,6 +501,42 @@ function test_leave() assert(u.building==b1) end +function test_mallorn() + free_game() + local r = region.create(0, 0, "plain") + r:set_flag(1, false) -- not mallorn + r:set_resource("tree", 100) + assert(r:get_resource("tree")==100) + local m = region.create(0, 0, "plain") + m:set_flag(1, true) -- not mallorn + m:set_resource("tree", 100) + assert(m:get_resource("tree")==100) + + local f = faction.create("enno@eressea.de", "human", "de") + + local u1 = unit.create(f, r, 1) + u1:add_item("money", u1.number * 100) + u1:set_skill("forestry", 2) + u1:clear_orders() + u1:add_order("MACHE HOLZ") + + local u2 = unit.create(f, m, 1) + u2:add_item("money", u2.number * 100) + u2:set_skill("forestry", 2) + u2:clear_orders() + u2:add_order("MACHE HOLZ") + + local u3 = unit.create(f, m, 1) + u3:add_item("money", u3.number * 100) + u3:set_skill("forestry", 2) + u3:clear_orders() + u3:add_order("MACHE Mallorn") + process_orders() + assert(u1:get_item("log")==2) + assert(u2:get_item("log")==2) + assert(u3:get_item("mallorn")==1) +end + function test_storage() free_game() local r = region.create(0, 0, "plain") @@ -547,12 +583,14 @@ tests = { ["herbalism"] = test_herbalism, ["storage"] = test_storage, ["taxes"] = test_taxes, + ["mallorn"] = test_mallorn, ["upkeep"] = test_upkeep, ["id"] = test_id, ["work"] = test_work, ["market"] = test_market } mytests = { + ["mallorn"] = test_mallorn, ["recruit2"] = test_recruit2 } fail = 0