Merge lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity into lp:widelands

Proposed by hessenfarmer
Status: Merged
Merged at revision: 9087
Proposed branch: lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity
Merge into: lp:widelands
Diff against target: 21 lines (+6/-4)
1 file modified
src/logic/map_objects/tribes/ship.cc (+6/-4)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+366599@code.launchpad.net

Commit message

Description of the change

when founding a port from an expedition ship a constructionsite is placed the radius where immovables are cleared is increased from 2 to 3. Furthermore not only trees are cleared but rocks as well (before only trees were cleared)

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

Code LGTM, not tested.

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4818. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/525149967.
Appveyor build 4599. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug1642882_clear_space_in_port_vicinity-4599.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Tested.

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/logic/map_objects/tribes/ship.cc'
2--- src/logic/map_objects/tribes/ship.cc 2019-04-24 15:11:23 +0000
3+++ src/logic/map_objects/tribes/ship.cc 2019-04-26 20:50:19 +0000
4@@ -920,11 +920,13 @@
5 get_owner()->force_csite(c, get_owner()->tribe().port());
6
7 // Make sure that we have space to squeeze in a lumberjack
8- std::vector<ImmovableFound> trees;
9- game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 2), &trees,
10+ std::vector<ImmovableFound> trees_rocks;
11+ game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 3), &trees_rocks,
12 FindImmovableAttribute(MapObjectDescr::get_attribute_id("tree")));
13- for (auto& tree : trees) {
14- tree.object->remove(game);
15+ game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 3), &trees_rocks,
16+ FindImmovableAttribute(MapObjectDescr::get_attribute_id("rocks")));
17+ for (auto& immo : trees_rocks) {
18+ immo.object->remove(game);
19 }
20 set_ship_state_and_notify(
21 ShipStates::kExpeditionColonizing, NoteShip::Action::kDestinationChanged);

Subscribers

People subscribed via source and target branches

to status/vote changes: