forked from github/server
Meermenschen konnten nicht aus fahrenden Schiffen springen.
This commit is contained in:
parent
dde2f3644e
commit
b7b6c4b668
2 changed files with 37 additions and 1 deletions
|
@ -182,3 +182,39 @@ function test_move_to_same_region_leaves_building()
|
||||||
assert_equal(r1, u.region)
|
assert_equal(r1, u.region)
|
||||||
assert_nil(u.building)
|
assert_nil(u.building)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_aquarians_can_swim()
|
||||||
|
local r1 = region.create(0, 0, "plain")
|
||||||
|
local r2 = region.create(1, 0, "ocean")
|
||||||
|
local r3 = region.create(2, 0, "ocean")
|
||||||
|
local f = faction.create("aquarian")
|
||||||
|
local u1 = unit.create(f, r2, 1)
|
||||||
|
local u2 = unit.create(f, r2, 1)
|
||||||
|
local sh = ship.create(r2, 'boat')
|
||||||
|
u1.ship = sh
|
||||||
|
u1:set_skill('sailing', 2)
|
||||||
|
u1:add_order("NACH O")
|
||||||
|
u2.ship = sh
|
||||||
|
u2.name = 'Zolgrim'
|
||||||
|
u2:add_order("NACH W")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(r1, u2.region)
|
||||||
|
assert_equal(r3, u1.region)
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_looping_ship()
|
||||||
|
local r1 = region.create(0, 0, "plain")
|
||||||
|
local r2 = region.create(1, 0, "ocean")
|
||||||
|
local f = faction.create("aquarian")
|
||||||
|
local u1 = unit.create(f, r1, 1)
|
||||||
|
u1.ship = ship.create(r1, 'boat')
|
||||||
|
local u2 = unit.create(f, r1, 1)
|
||||||
|
u2.ship = ship.create(r1, 'boat')
|
||||||
|
u1:set_skill('sailing', 2)
|
||||||
|
u1:add_order("NACH O W")
|
||||||
|
u2:set_skill('sailing', 2)
|
||||||
|
u2:add_order("NACH O")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(r1, u1.region)
|
||||||
|
assert_equal(r2, u2.region)
|
||||||
|
end
|
||||||
|
|
|
@ -2421,7 +2421,7 @@ void move_units(void)
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit* u = *up;
|
unit* u = *up;
|
||||||
up = &u->next;
|
up = &u->next;
|
||||||
if (!u->ship) {
|
if (!u->ship || ship_owner(u->ship) != u) {
|
||||||
keyword_t kword = getkeyword(u->thisorder);
|
keyword_t kword = getkeyword(u->thisorder);
|
||||||
|
|
||||||
if (kword == K_ROUTE || kword == K_MOVE) {
|
if (kword == K_ROUTE || kword == K_MOVE) {
|
||||||
|
|
Loading…
Reference in a new issue