test that money has weight, add weight in init_resources (TODO: use the config files).

This commit is contained in:
Enno Rehling 2015-01-14 07:46:42 +01:00
parent 29fc0fe6c3
commit 468882f974
2 changed files with 18 additions and 0 deletions

View File

@ -712,6 +712,23 @@ function test_golem_use_four_iron()
assert_equal(4, u1:get_item("towershield"))
end
function test_silver_weight_stops_movement()
local r1 = region.create(1, 1, "plain")
local r2 = region.create(2, 1, "plain")
region.create(3, 1, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
u1:clear_orders()
u1:add_order("NACH OST")
u1:add_item("money", 540)
assert_equal(1540, u1.weight)
process_orders()
assert_equal(r2, u1.region)
u1:add_item("money", 1)
process_orders()
assert_equal(r2, u1.region)
end
function test_building_owner_can_enter_ship()
local r1 = region.create(1, 2, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")

View File

@ -960,6 +960,7 @@ void init_resources(void)
rtype->uchange = res_changeitem;
rtype->itype = it_get_or_create(rtype);
rtype->itype->give = give_money;
rtype->itype->weight = 1;
// R_PERMAURA
rtype = rt_get_or_create(resourcenames[R_PERMAURA]);