Merge lp:~widelands-dev/widelands/ai_quarry_fix into lp:widelands

Proposed by TiborB
Status: Merged
Merged at revision: 8601
Proposed branch: lp:~widelands-dev/widelands/ai_quarry_fix
Merge into: lp:widelands
Diff against target: 13 lines (+3/-0)
1 file modified
src/ai/defaultai.cc (+3/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/ai_quarry_fix
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+338585@code.launchpad.net

Commit message

When considering a quarry, the AI makes sure there is at least one rock in the vicinity

Description of the change

When considering a quarry AI makes sure there is at least one rock in vicinity

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

Continuous integration builds have changed state:

Travis build 3226. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/345003980.
Appveyor build 3035. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_quarry_fix-3035.

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM :)

@bunnybot merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ai/defaultai.cc'
2--- src/ai/defaultai.cc 2018-02-20 11:57:18 +0000
3+++ src/ai/defaultai.cc 2018-02-22 21:11:46 +0000
4@@ -2611,6 +2611,9 @@
5 // Quarries are generally to be built everywhere where rocks are
6 // no matter the need for granite, as rocks are considered an obstacle
7 // to expansion
8+ if (bf->rocks_nearby < 1) {
9+ continue;
10+ }
11 prio += 2 * bf->rocks_nearby;
12
13 if (bf->rocks_nearby > 0 && bf->near_border) {

Subscribers

People subscribed via source and target branches

to status/vote changes: