Merge lp://qastaging/~widelands-dev/widelands/reed-compatibility into lp://qastaging/widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 9146
Proposed branch: lp://qastaging/~widelands-dev/widelands/reed-compatibility
Merge into: lp://qastaging/widelands
Diff against target: 823 lines (+122/-91)
19 files modified
src/economy/expedition_bootstrap.cc (+3/-3)
src/economy/expedition_bootstrap.h (+1/-1)
src/economy/input_queue.cc (+7/-6)
src/economy/input_queue.h (+1/-1)
src/economy/request.cc (+3/-3)
src/economy/request.h (+2/-1)
src/game_io/game_player_info_packet.cc (+2/-2)
src/map_io/map_buildingdata_packet.cc (+42/-38)
src/map_io/map_buildingdata_packet.h (+9/-8)
src/map_io/map_flagdata_packet.cc (+2/-2)
src/map_io/map_flagdata_packet.h (+8/-1)
src/map_io/map_object_packet.cc (+4/-4)
src/map_io/map_object_packet.h (+1/-1)
src/map_io/map_players_view_packet.cc (+9/-9)
src/map_io/map_players_view_packet.h (+10/-1)
src/map_io/map_roaddata_packet.cc (+2/-2)
src/map_io/map_roaddata_packet.h (+8/-1)
src/map_io/tribes_legacy_lookup_table.cc (+2/-1)
src/map_io/widelands_map_loader.cc (+6/-6)
To merge this branch: bzr merge lp://qastaging/~widelands-dev/widelands/reed-compatibility
Reviewer Review Type Date Requested Status
hessenfarmer Approve
Review via email: mp+367935@code.qastaging.launchpad.net

Commit message

Fix savegame compatibility for reed, buildings, players view and economy requests.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5058. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/537337141.
Appveyor build 4838. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_reed_compatibility-4838.

Revision history for this message
Notabilis (notabilis27) wrote :

So ... you created a diff of 800 lines by passing objects around so you can call a method in only a handful of places?? I like it! :)
The changes are mostly looking good to me. Replacing the GOTO might be broken, though, see my diff comment below.

I haven't tested the changes, mostly because I have no sensible idea how to do so. But based on the code I guess it shouldn't break anything.

Revision history for this message
GunChleoc (gunchleoc) wrote :

> So ... you created a diff of 800 lines by passing objects around so you can call a method in only a handful of places?? I like it! :)

Lol yep. It will save a bit of memory though if the objects are created only once.

For triggering the bug, you need a savegame created with bzr9118 or older that has reed or wheat fields on it.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5154. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/541619525.
Appveyor build 4936. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_reed_compatibility-4936.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I have added a second if statement for the test variable to simulate the effect of the goto and break out of the outer loop. Thanks for the review!

@bunybot merge

Revision history for this message
Notabilis (notabilis27) wrote :

Sorry, I am having second thoughts about the goto-part. Actually, I am not only unsure about the goto-replacement but over the whole code part independent of your changes. :-/
If I understand it right, the code iterates over the possible jobs in the production site. If there is a job the loaded worker can work on, we iterate over all working positions of the site and check if *any* of these is empty, so we can assign the worker. Shouldn't we only check the working positions that are for the required job? Otherwise, the code could break with production sites which have multiple types of worker positions (Mines probably? These need a miner and a master miner).

Maybe I am just confused and the code is fine, but it would be good if someone could check it.

Revision history for this message
GunChleoc (gunchleoc) wrote :

This code is pretty old, so I'm sure we would have had bug reports for it in the past if it was broken. It should be fine if iterating starts with the most advanced working position, because then we won't put a master miner i a miner's slot and end up stumped when we have to put a miner in a master miner's slot, which is not allowed.

I'll reinstate the goto to make sure we can't possibly have any accidental semantic changes, so that we can get this bugfix in.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Done. Thanks for the review!

@bunnybot merge

Revision history for this message
GunChleoc (gunchleoc) wrote :

Inputqueues again

@bunnybot merge force

Revision history for this message
bunnybot (widelandsofficial) wrote :

Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.

Travis build 5164. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/542121335.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

@bunnybot merge force

Revision history for this message
hessenfarmer (stephan-lutz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: