CID 182781 I broke the wage logic.

This commit is contained in:
Enno Rehling 2018-02-10 17:53:59 +01:00
parent e300605e87
commit eb6271bbb8
3 changed files with 20 additions and 2 deletions

View file

@ -9,6 +9,7 @@ function setup()
eressea.settings.set("rules.ship.storms", "0") eressea.settings.set("rules.ship.storms", "0")
eressea.settings.set("rules.encounters", "0") eressea.settings.set("rules.encounters", "0")
eressea.settings.set("study.produceexp", "0") eressea.settings.set("study.produceexp", "0")
eressea.settings.set("rules.peasants.growth.factor", "0")
end end
function test_calendar() function test_calendar()
@ -19,7 +20,7 @@ end
function test_herbalism() function test_herbalism()
-- OBS: herbalism is currently an E2-only skill -- OBS: herbalism is currently an E2-only skill
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")
local f = faction.create("human", "herbalism@eressea.de", "de") local f = faction.create("human")
local u = unit.create(f, r, 1) local u = unit.create(f, r, 1)
eressea.settings.set("rules.grow.formula", 0) -- plants do not grow eressea.settings.set("rules.grow.formula", 0) -- plants do not grow

View file

@ -9,6 +9,22 @@ function setup()
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.food.flags", "4") -- FOOD_IS_FREE eressea.settings.set("rules.food.flags", "4") -- FOOD_IS_FREE
eressea.settings.set("rules.encounters", "0") eressea.settings.set("rules.encounters", "0")
eressea.settings.set("rules.peasants.growth.factor", "0")
end
function test_work()
local r = region.create(0, 0, "plain")
r:set_resource('tree', 0)
r:set_resource('seed', 0)
r:set_resource('sapling', 0)
r:set_resource('peasant', 100)
r:set_resource('money', 0)
local f = faction.create("human")
local u = unit.create(f, r, 1)
u:add_order("ARBEITE")
process_orders()
assert_equal(10, u:get_item('money'))
assert_equal(100, r:get_resource('money'))
end end
function test_bug_2361_forget_magic() function test_bug_2361_forget_magic()

View file

@ -724,13 +724,14 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
if (r->attribs) { if (r->attribs) {
attrib *a; attrib *a;
curse *c; curse *c;
variant vm = frac_make(wage, 1); variant vm;
/* Godcurse: Income -10 */ /* Godcurse: Income -10 */
c = get_curse(r->attribs, &ct_godcursezone); c = get_curse(r->attribs, &ct_godcursezone);
if (c && curse_active(c)) { if (c && curse_active(c)) {
wage = (wage < 10) ? 0 : (wage - 10); wage = (wage < 10) ? 0 : (wage - 10);
} }
vm = frac_make(wage, 1);
/* Bei einer D<>rre verdient man nur noch ein Viertel */ /* Bei einer D<>rre verdient man nur noch ein Viertel */
c = get_curse(r->attribs, &ct_drought); c = get_curse(r->attribs, &ct_drought);