forked from github/server
check that newbie immunity prevents guarding
This commit is contained in:
parent
77cf7f6876
commit
abd2a398d1
1 changed files with 16 additions and 0 deletions
|
@ -1160,3 +1160,19 @@ function test_bug_2393_cart()
|
|||
process_orders()
|
||||
assert_equal(r1, u.region)
|
||||
end
|
||||
|
||||
function test_immunity_stops_guard()
|
||||
eressea.settings.set("NewbieImmunity", 2)
|
||||
local f = faction.create('human')
|
||||
local r = region.create(0, 0, 'plain')
|
||||
local u = unit.create(f, r)
|
||||
u:set_skill('polearm', 2)
|
||||
u:add_item('lance', 1)
|
||||
u:add_order('BEWACHE')
|
||||
process_orders()
|
||||
assert_equal(f.age, 1)
|
||||
assert_true(not u.guard)
|
||||
process_orders()
|
||||
assert_equal(f.age, 2)
|
||||
assert_true(u.guard)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue