From ec571924037cc06b23eff622b828f865cd65a57b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 30 Jul 2018 22:19:40 +0200 Subject: [PATCH] equip_newunits got called twice. --- scripts/eressea/equipment.lua | 1 - scripts/tests/config.lua | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/eressea/equipment.lua b/scripts/eressea/equipment.lua index 8852dfb27..c7bfe7dad 100644 --- a/scripts/eressea/equipment.lua +++ b/scripts/eressea/equipment.lua @@ -2,7 +2,6 @@ local self = {} local function equip_first(u) - equip_newunits(u) name = 'seed_' .. u.race equip_unit(u, name, 255) end diff --git a/scripts/tests/config.lua b/scripts/tests/config.lua index 316a8ccca..733a8ee07 100644 --- a/scripts/tests/config.lua +++ b/scripts/tests/config.lua @@ -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 +