forked from github/server
CID 182781 I broke the wage logic.
This commit is contained in:
parent
e300605e87
commit
eb6271bbb8
|
@ -9,6 +9,7 @@ function setup()
|
|||
eressea.settings.set("rules.ship.storms", "0")
|
||||
eressea.settings.set("rules.encounters", "0")
|
||||
eressea.settings.set("study.produceexp", "0")
|
||||
eressea.settings.set("rules.peasants.growth.factor", "0")
|
||||
end
|
||||
|
||||
function test_calendar()
|
||||
|
@ -19,7 +20,7 @@ end
|
|||
function test_herbalism()
|
||||
-- OBS: herbalism is currently an E2-only skill
|
||||
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)
|
||||
|
||||
eressea.settings.set("rules.grow.formula", 0) -- plants do not grow
|
||||
|
|
|
@ -9,6 +9,22 @@ function setup()
|
|||
eressea.settings.set("nmr.timeout", "0")
|
||||
eressea.settings.set("rules.food.flags", "4") -- FOOD_IS_FREE
|
||||
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
|
||||
|
||||
function test_bug_2361_forget_magic()
|
||||
|
|
|
@ -724,13 +724,14 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
|
|||
if (r->attribs) {
|
||||
attrib *a;
|
||||
curse *c;
|
||||
variant vm = frac_make(wage, 1);
|
||||
variant vm;
|
||||
|
||||
/* Godcurse: Income -10 */
|
||||
c = get_curse(r->attribs, &ct_godcursezone);
|
||||
if (c && curse_active(c)) {
|
||||
wage = (wage < 10) ? 0 : (wage - 10);
|
||||
}
|
||||
vm = frac_make(wage, 1);
|
||||
|
||||
/* Bei einer D<>rre verdient man nur noch ein Viertel */
|
||||
c = get_curse(r->attribs, &ct_drought);
|
||||
|
|
Loading…
Reference in New Issue