widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #12700
[Merge] lp:~widelands-dev/widelands/ai_quarry_fix into lp:widelands
TiborB has proposed merging lp:~widelands-dev/widelands/ai_quarry_fix into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_quarry_fix/+merge/338585
When considering a quarry AI makes sure there is at least one rock in vicinity
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_quarry_fix into lp:widelands.
=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc 2018-02-20 11:57:18 +0000
+++ src/ai/defaultai.cc 2018-02-22 21:11:46 +0000
@@ -2611,6 +2611,9 @@
// Quarries are generally to be built everywhere where rocks are
// no matter the need for granite, as rocks are considered an obstacle
// to expansion
+ if (bf->rocks_nearby < 1) {
+ continue;
+ }
prio += 2 * bf->rocks_nearby;
if (bf->rocks_nearby > 0 && bf->near_border) {
Follow ups