TiborB has proposed merging lp:~widelands-dev/widelands/ai_mineable_buildable 
into lp:widelands.

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.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_mineable_buildable/+merge/342601

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.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_mineable_buildable into lp:widelands.
=== modified file 'src/ai/ai_help_structs.cc'
--- src/ai/ai_help_structs.cc	2018-03-26 18:15:38 +0000
+++ src/ai/ai_help_structs.cc	2018-04-03 19:35:24 +0000
@@ -195,7 +195,8 @@
 }
 
 bool FindNodeUnownedBuildable::accept(const Map&, const FCoords& fc) const {
-	return (fc.field->nodecaps() & BUILDCAPS_SIZEMASK) && (fc.field->get_owned_by() == neutral());
+	return ((fc.field->nodecaps() & BUILDCAPS_SIZEMASK) || (fc.field->nodecaps() & BUILDCAPS_MINE)) &&
+			(fc.field->get_owned_by() == neutral());
 }
 
 // Unowned but walkable fields nearby

=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h	2018-03-26 18:15:38 +0000
+++ src/ai/ai_help_structs.h	2018-04-03 19:35:24 +0000
@@ -208,7 +208,7 @@
 };
 
 // When looking for unowned terrain to acquire, we must
-// consider if any buildings can be built on unowned land.
+// consider if any buildings (incl. mines) can be built on unowned land.
 struct FindNodeUnownedBuildable {
 	FindNodeUnownedBuildable(Player* p, Game& g);
 

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to