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

Proposed by TiborB
Status: Merged
Merged at revision: 8643
Proposed branch: lp:~widelands-dev/widelands/ai_mineable_buildable
Merge into: lp:widelands
Diff against target: 25 lines (+3/-2)
2 files modified
src/ai/ai_help_structs.cc (+2/-1)
src/ai/ai_help_structs.h (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/ai_mineable_buildable
Reviewer Review Type Date Requested Status
GunChleoc Approve
hessenfarmer playtest Approve
Review via email: mp+342601@code.launchpad.net

Commit message

AI tweak - when looking for nearest buildable spot, it accepts also mineable fields. This affects willingness to expand when there are no buildable spots nearby, but some mines can be conquered by new militarysite.

Description of the change

AI tweak - when looking for nearest buildable spot, it accepts also mineable fields. This affects willingness to expand when there are no buildable spots nearby, but some mines can be conquered by new militarysite.

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

Continuous integration builds have changed state:

Travis build 3339. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/361802857.
Appveyor build 3145. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_mineable_buildable-3145.

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

Code looks good to me. Will test this evening.

So I think we can consider
https://code.launchpad.net/~widelands-dev/widelands/mineable_fields
 an abandoned branch now.

Revision history for this message
TiborB (tiborb95) wrote :

Yes, this one does almost the same though with bit different approach

and I must admit I completely forgot about this branch...

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

fix is working.
can go in from my side

review: Approve (playtest)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Code looks good too.

@bunnybot merge

review: Approve
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 3339. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/361802857.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Transient failure on Travis

@bunnybot merge force

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ai/ai_help_structs.cc'
2--- src/ai/ai_help_structs.cc 2018-03-26 18:15:38 +0000
3+++ src/ai/ai_help_structs.cc 2018-04-03 19:35:24 +0000
4@@ -195,7 +195,8 @@
5 }
6
7 bool FindNodeUnownedBuildable::accept(const Map&, const FCoords& fc) const {
8- return (fc.field->nodecaps() & BUILDCAPS_SIZEMASK) && (fc.field->get_owned_by() == neutral());
9+ return ((fc.field->nodecaps() & BUILDCAPS_SIZEMASK) || (fc.field->nodecaps() & BUILDCAPS_MINE)) &&
10+ (fc.field->get_owned_by() == neutral());
11 }
12
13 // Unowned but walkable fields nearby
14
15=== modified file 'src/ai/ai_help_structs.h'
16--- src/ai/ai_help_structs.h 2018-03-26 18:15:38 +0000
17+++ src/ai/ai_help_structs.h 2018-04-03 19:35:24 +0000
18@@ -208,7 +208,7 @@
19 };
20
21 // When looking for unowned terrain to acquire, we must
22-// consider if any buildings can be built on unowned land.
23+// consider if any buildings (incl. mines) can be built on unowned land.
24 struct FindNodeUnownedBuildable {
25 FindNodeUnownedBuildable(Player* p, Game& g);
26

Subscribers

People subscribed via source and target branches

to status/vote changes: