widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #12566
[Merge] lp:~widelands-dev/widelands/ai_militarysites_prohibited into lp:widelands
TiborB has proposed merging lp:~widelands-dev/widelands/ai_militarysites_prohibited into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1749716 in widelands: "aihints for military buildings"
https://bugs.launchpad.net/widelands/+bug/1749716
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_militarysites_prohibited/+merge/337822
Adding simple test to consider if a militarysite to be built is "prohibited_till" in aihints
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_militarysites_prohibited into lp:widelands.
=== modified file 'src/ai/defaultai_warfare.cc'
--- src/ai/defaultai_warfare.cc 2017-11-13 09:10:04 +0000
+++ src/ai/defaultai_warfare.cc 2018-02-15 20:40:53 +0000
@@ -970,6 +970,11 @@
return BuildingNecessity::kForbidden;
}
+ // Skip if the building is prohibited for now
+ if (bo.prohibited_till > gametime) {
+ return BuildingNecessity::kForbidden;
+ }
+
bo.primary_priority = 0;
const uint32_t msites_total = msites_built() + msites_in_constr();
Follow ups