Browse Source

Little tweak - prioritize instant buildings over ones we can't afford. May be useful with multiple towns.

DJWarmonger 7 years ago
parent
commit
8eec7d71ad
1 changed files with 2 additions and 2 deletions
  1. 2 2
      AI/VCAI/Goals.cpp

+ 2 - 2
AI/VCAI/Goals.cpp

@@ -1417,7 +1417,7 @@ TGoalVec Goals::Build::getAllPossibleSubgoals()
 		auto ib = ah->immediateBuilding();
 		if (ib.is_initialized())
 		{
-			ret.push_back(sptr(Goals::BuildThis(ib.get().bid, t)));
+			ret.push_back(sptr(Goals::BuildThis(ib.get().bid, t).setpriority(2))); //prioritize buildings we can build quick
 		}
 		else //try build later
 		{
@@ -1425,7 +1425,7 @@ TGoalVec Goals::Build::getAllPossibleSubgoals()
 			if (eb.is_initialized())
 			{
 				auto pb = eb.get(); //gather resources for any we can't afford
-				auto goal = ah->whatToDo(pb.price, sptr(Goals::BuildThis(pb.bid, t)));
+				auto goal = ah->whatToDo(pb.price, sptr(Goals::BuildThis(pb.bid, t).setpriority(0.5)));
 				ret.push_back(goal);
 			}
 		}