widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #16694
[Merge] lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity into lp:widelands
hessenfarmer has proposed merging lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity into lp:widelands.
Commit message:
fixes bug 1642882
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1642882 in widelands: "Port should clear enough land to build"
https://bugs.launchpad.net/widelands/+bug/1642882
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity/+merge/366599
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)
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug1642882-clear-space-in-port-vicinity into lp:widelands.
=== modified file 'src/logic/map_objects/tribes/ship.cc'
--- src/logic/map_objects/tribes/ship.cc 2019-04-24 15:11:23 +0000
+++ src/logic/map_objects/tribes/ship.cc 2019-04-26 20:50:19 +0000
@@ -920,11 +920,13 @@
get_owner()->force_csite(c, get_owner()->tribe().port());
// Make sure that we have space to squeeze in a lumberjack
- std::vector<ImmovableFound> trees;
- game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 2), &trees,
+ std::vector<ImmovableFound> trees_rocks;
+ game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 3), &trees_rocks,
FindImmovableAttribute(MapObjectDescr::get_attribute_id("tree")));
- for (auto& tree : trees) {
- tree.object->remove(game);
+ game.map().find_immovables(Area<FCoords>(game.map().get_fcoords(c), 3), &trees_rocks,
+ FindImmovableAttribute(MapObjectDescr::get_attribute_id("rocks")));
+ for (auto& immo : trees_rocks) {
+ immo.object->remove(game);
}
set_ship_state_and_notify(
ShipStates::kExpeditionColonizing, NoteShip::Action::kDestinationChanged);
Follow ups