From 2107a84b0d47693a84f28399c7fa5f5ee360309c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Jul 2017 15:25:33 +0200 Subject: [PATCH] also allow GIVE for ghouls and skeletons. --- res/e3a/races.xml | 4 ++-- res/eressea/races.xml | 4 ++-- scripts/tests/undead.lua | 26 +++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/res/e3a/races.xml b/res/e3a/races.xml index 349b60a09..48162aa26 100644 --- a/res/e3a/races.xml +++ b/res/e3a/races.xml @@ -750,7 +750,7 @@ - + @@ -812,7 +812,7 @@ - + diff --git a/res/eressea/races.xml b/res/eressea/races.xml index 56c0c541b..2af45fc60 100644 --- a/res/eressea/races.xml +++ b/res/eressea/races.xml @@ -1000,7 +1000,7 @@ - + @@ -1058,7 +1058,7 @@ - + diff --git a/scripts/tests/undead.lua b/scripts/tests/undead.lua index 1ed94620b..121701b1e 100644 --- a/scripts/tests/undead.lua +++ b/scripts/tests/undead.lua @@ -54,7 +54,7 @@ function test_give_other_zombie_fail() end function test_give_self_zombie_okay() - -- allow giving undead units to own units of same race + -- allow giving zombie units to own units of same race local r = region.create(0, 0, "plain") local f = faction.create("human") local u1 = unit.create(f, r, 2, "zombie") @@ -64,3 +64,27 @@ function test_give_self_zombie_okay() assert_equal(1, u1.number) assert_equal(2, u2.number) end + +function test_give_self_skeleton_okay() + -- allow giving skeleton units to own units of same race + local r = region.create(0, 0, "plain") + local f = faction.create("human") + local u1 = unit.create(f, r, 2, "skeleton") + local u2 = unit.create(f, r, 1, "skeleton") + u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON") + process_orders() + assert_equal(1, u1.number) + assert_equal(2, u2.number) +end + +function test_give_self_ghoul_okay() + -- allow giving ghoul units to own units of same race + local r = region.create(0, 0, "plain") + local f = faction.create("human") + local u1 = unit.create(f, r, 2, "ghoul") + local u2 = unit.create(f, r, 1, "ghoul") + u1:add_order("GIB " .. itoa36(u2.id) .. " 1 PERSON") + process_orders() + assert_equal(1, u1.number) + assert_equal(2, u2.number) +end