forked from github/server
Test failed due to drifting ships
This commit is contained in:
parent
3a57fedecb
commit
25bf66e123
4 changed files with 38 additions and 35 deletions
|
@ -1020,7 +1020,7 @@ get_addresses(report_context * ctx)
|
||||||
ctx->addresses = flist;
|
ctx->addresses = flist;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAXSEEHASH 0x3000
|
#define MAXSEEHASH 0x1000
|
||||||
seen_region * reuse;
|
seen_region * reuse;
|
||||||
|
|
||||||
seen_region **
|
seen_region **
|
||||||
|
|
|
@ -45,8 +45,9 @@ function run_turn()
|
||||||
|
|
||||||
orderfile = orderfile or basepath .. '/orders.' .. turn
|
orderfile = orderfile or basepath .. '/orders.' .. turn
|
||||||
print("executing turn " .. get_turn() .. " with " .. orderfile)
|
print("executing turn " .. get_turn() .. " with " .. orderfile)
|
||||||
process(orderfile, confirmed_multis, suspected_multis, locales)
|
local result = process(orderfile, confirmed_multis, suspected_multis, locales)
|
||||||
|
if result==0 then
|
||||||
dbupdate()
|
dbupdate()
|
||||||
|
end
|
||||||
return 0
|
return result
|
||||||
end
|
end
|
||||||
|
|
|
@ -191,6 +191,7 @@ function process(orders, confirmed_multis, suspected_multis, locales)
|
||||||
print("could not write game")
|
print("could not write game")
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
@ -8,7 +8,8 @@ end
|
||||||
|
|
||||||
function test_capacity()
|
function test_capacity()
|
||||||
local r = region.create(0,0, "ocean")
|
local r = region.create(0,0, "ocean")
|
||||||
local r2 = region.create(1,0, "ocean")
|
region.create(1,0, "ocean")
|
||||||
|
local r2 = region.create(2,0, "ocean")
|
||||||
local f = faction.create("noreply@eressea.de", "human", "de")
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
|
|
||||||
local s1 = ship.create(r, "cutter")
|
local s1 = ship.create(r, "cutter")
|
||||||
|
@ -16,20 +17,20 @@ function test_capacity()
|
||||||
u1.ship = s1
|
u1.ship = s1
|
||||||
u1:set_skill("sailing", 10)
|
u1:set_skill("sailing", 10)
|
||||||
u1:clear_orders()
|
u1:clear_orders()
|
||||||
u1:add_order("NACH O")
|
u1:add_order("NACH O O")
|
||||||
|
|
||||||
local s2 = ship.create(r, "cutter")
|
local s2 = ship.create(r, "cutter")
|
||||||
local u2 = unit.create(f, r, 6)
|
local u2 = unit.create(f, r, 6)
|
||||||
u2.ship = s2
|
u2.ship = s2
|
||||||
u2:set_skill("sailing", 10)
|
u2:set_skill("sailing", 10)
|
||||||
u2:clear_orders()
|
u2:clear_orders()
|
||||||
u2:add_order("NACH O")
|
u2:add_order("NACH O O")
|
||||||
|
|
||||||
update_owners()
|
update_owners()
|
||||||
process_orders()
|
process_orders()
|
||||||
-- print(s.region, u.region, r2)
|
-- print(s.region, u.region, r2)
|
||||||
assert_equal(r2.id, u1.region.id)
|
assert_equal(r2.id, u1.region.id)
|
||||||
assert_equal(r.id, u2.region.id)
|
assert_not_equal(r2.id, u2.region.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_owners()
|
function test_owners()
|
||||||
|
|
Loading…
Reference in a new issue