forked from github/server
parent
a452ad1517
commit
b0a986e155
|
@ -50,26 +50,3 @@ function test_build_packice()
|
||||||
process_orders()
|
process_orders()
|
||||||
assert_equal(nil, u.building)
|
assert_equal(nil, u.building)
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_build_castle_stages()
|
|
||||||
local r = region.create(0,0, "plain")
|
|
||||||
local f = faction.create("castle@eressea.de", "human", "de")
|
|
||||||
local u = unit.create(f, r, 1000)
|
|
||||||
local b = building.create(r, "castle")
|
|
||||||
|
|
||||||
u:add_item("stone", 1000)
|
|
||||||
|
|
||||||
u:set_skill("building", 1)
|
|
||||||
u:clear_orders()
|
|
||||||
|
|
||||||
u:add_order("MACHE BURG " .. itoa36(b.id))
|
|
||||||
process_orders()
|
|
||||||
assert_equal(10, b.size)
|
|
||||||
|
|
||||||
u:set_skill("building", 3)
|
|
||||||
u:clear_orders()
|
|
||||||
|
|
||||||
u:add_order("MACHE BURG " .. itoa36(b.id))
|
|
||||||
process_orders()
|
|
||||||
assert_equal(250, b.size)
|
|
||||||
end
|
|
||||||
|
|
|
@ -522,9 +522,7 @@ int build(unit * u, const construction * ctype, int completed, int want)
|
||||||
|
|
||||||
if (basesk < type->minskill) {
|
if (basesk < type->minskill) {
|
||||||
if (made == 0)
|
if (made == 0)
|
||||||
return ELOWSKILL;
|
return ELOWSKILL; /* not good enough to go on */
|
||||||
else
|
|
||||||
return made; /* not good enough to go on */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* n = maximum buildable size */
|
/* n = maximum buildable size */
|
||||||
|
|
Loading…
Reference in New Issue