equip_newunits got called twice.

This commit is contained in:
Enno Rehling 2018-07-30 22:19:40 +02:00 committed by Enno Rehling
parent 65768a52e9
commit ec57192403
2 changed files with 21 additions and 1 deletions

View File

@ -2,7 +2,6 @@
local self = {}
local function equip_first(u)
equip_newunits(u)
name = 'seed_' .. u.race
equip_unit(u, name, 255)
end

View File

@ -30,6 +30,26 @@ function test_first_troll()
assert_equal(2, u:eff_skill('perception'))
end
function test_first_human()
local f = faction.create('human')
local r = region.create(0, 0, "plain")
local u = unit.create(f, r, 1)
u:equip('first_unit')
assert_not_nil(u.building)
assert_equal('castle', u.building.type)
assert_equal(10, u.building.size)
end
function test_first_aquarian()
local f = faction.create('aquarian')
local r = region.create(0, 0, "plain")
local u = unit.create(f, r, 1)
u:equip('first_unit')
assert_not_nil(u.ship)
assert_equal('boat', u.ship.type)
assert_equal(1, u:get_skill('sailing'))
end
function test_seed_unit()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
@ -53,3 +73,4 @@ function test_seed_elf()
assert_equal('castle', u.building.type)
assert_equal(10, u.building.size)
end