widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #04448
[Merge] lp:~widelands-dev/widelands/bug-1506084 into lp:widelands
TiborB has proposed merging lp:~widelands-dev/widelands/bug-1506084 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1506084 in widelands: "Regressiontest failing"
https://bugs.launchpad.net/widelands/+bug/1506084
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1506084/+merge/274758
This fixes regression test fail (I hope). Two issues here:
test script not working properly (changed, I added more sleeps)
small change in fleet/ship logic
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1506084 into lp:widelands.
=== modified file 'src/logic/ship.cc'
--- src/logic/ship.cc 2015-09-03 12:56:54 +0000
+++ src/logic/ship.cc 2015-10-16 19:02:13 +0000
@@ -242,8 +242,12 @@
PortDock* dst = get_destination(game);
if (!dst) {
- //here we just do nothing, this is usually OK
+ // The ship has lost its destination (port is gone perhaps) so
+ // stop and start being idle
start_task_idle(game, descr().main_animation(), 10000);
+ // ...but let the fleet recalcualte ships destinations (this ship
+ // needs new destination)
+ m_fleet->update(game);
return true;
}
=== modified file 'test/maps/ship_transportation.wmf/scripting/test_rip_second_port_with_ware_in_portdock.lua'
--- test/maps/ship_transportation.wmf/scripting/test_rip_second_port_with_ware_in_portdock.lua 2014-01-18 12:40:08 +0000
+++ test/maps/ship_transportation.wmf/scripting/test_rip_second_port_with_ware_in_portdock.lua 2015-10-16 19:02:13 +0000
@@ -9,27 +9,40 @@
port1():set_wares{
blackwood = 1,
}
- sleep(12000)
+
+ sleep(1000)
- -- The ship should not yet have picked up the worker from the
+ -- The ship should not yet have picked up the ware from the
-- portdock.
assert_equal(p1:get_wares("blackwood"), 1)
assert_equal(port1():get_wares("blackwood"), 0)
+
+ while ship:get_wares() == 0 do
+ -- ship still on the way to the bottom port
+ sleep(50)
+ end
+ --now it is loaded with something and port empty..
+ sleep(2000)
+ assert_equal(port1():get_wares("blackwood"), 0)
+ -- ...and on the way to the north, so let remove the upper port
port2():remove()
sleep(100)
stable_save("ware_in_portdock")
- sleep(8000)
+ --ship has to get to the place of former upper port and then return back to the bottom port
+ sleep(30000)
- -- Worker should be back in port.
+ -- Ware should be back in port.
assert_equal(p1:get_wares("blackwood"), 1)
assert_equal(port1():get_wares("blackwood"), 1)
-- Create port again.
create_second_port()
-
+
+ sleep (10000)
+
while ship:get_wares() == 0 do
sleep(50)
end
Follow ups