Atlanteans campaign keeps counting 0 ships
Bug #1509220 reported by
GunChleoc
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Critical
|
TiborB |
Bug Description
The last objective in the Atlantean campaign never completes, because the size of the fleet always remains 0.
To reproduce, hack the scenario a bit so you won't have to play it through:
Add the following lines to intro():
p1:
check_
And the following line to check_for_ships():
print("ships: " .. nships)
Then build some support buildings and a shipyard. After the first ship is completed, you will still get this output: "ships: 0"
I tried simplifying the ship check to this:
local ships = p1:get_ships()
while #ships < 3 do
sleep(8234)
end
But it still fails.
Related branches
lp:~widelands-dev/widelands/fleet_update
- GunChleoc: Approve
-
Diff: 690 lines (+131/-134)15 files modifiedcampaigns/atl01.wmf/scripting/mission_thread.lua (+2/-24)
src/economy/fleet.cc (+6/-1)
src/logic/ship.cc (+4/-7)
test/maps/expedition.wmf/scripting/test_ship_movement_controls.lua (+18/-12)
test/maps/ship_transportation.wmf/scripting/init.lua (+4/-4)
test/maps/ship_transportation.wmf/scripting/test_rip_farm_with_ware_and_worker_in_transit.lua (+6/-6)
test/maps/ship_transportation.wmf/scripting/test_rip_first_port_with_ware_in_portdock.lua (+6/-6)
test/maps/ship_transportation.wmf/scripting/test_rip_first_port_with_worker_in_portdock.lua (+6/-6)
test/maps/ship_transportation.wmf/scripting/test_rip_portdock_with_worker_and_ware_in_transit.lua (+16/-16)
test/maps/ship_transportation.wmf/scripting/test_rip_ports_with_ware_in_transit.lua (+9/-9)
test/maps/ship_transportation.wmf/scripting/test_rip_ports_with_worker_in_transit.lua (+9/-9)
test/maps/ship_transportation.wmf/scripting/test_rip_second_port_with_ware_in_portdock.lua (+9/-9)
test/maps/ship_transportation.wmf/scripting/test_rip_second_port_with_worker_in_portdock.lua (+26/-15)
test/maps/ship_transportation.wmf/scripting/test_rip_ship_before_picking_up_transporting_ware.lua (+5/-5)
test/maps/ship_transportation.wmf/scripting/test_rip_ship_while_transporting_ware.lua (+5/-5)
description: | updated |
Changed in widelands: | |
status: | New → Fix Committed |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Regression tests (especially test_ship_ movement_ controls. lua) still pass?
your syntax is bad:
local ships = p1:get_ships() <-this must be re-run within every loop below
print( "ships: " .. #ships)
while #ships < 3 do
sleep(8234)
end
Would following work?
while #p1:get_ships() < 3 do
I am not that skilled with lua to say without testing.