فهرست منبع

Update Nullkiller.cpp

Don't trade away gold when the gold-pressure is high.
Xilmi 1 سال پیش
والد
کامیت
284f276108
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      AI/Nullkiller/Engine/Nullkiller.cpp

+ 2 - 2
AI/Nullkiller/Engine/Nullkiller.cpp

@@ -635,7 +635,7 @@ bool Nullkiller::handleTrading()
 
 
 					if (i == 6)
 					if (i == 6)
 					{
 					{
-						if (income[i] > 0)
+						if (income[i] > 0 && !buildAnalyzer->isGoldPressureHigh())
 							okToSell = true;
 							okToSell = true;
 					}
 					}
 					else
 					else
@@ -663,7 +663,7 @@ bool Nullkiller::handleTrading()
 				if (toGive && toGive <= available[mostExpendable]) //don't try to sell 0 resources
 				if (toGive && toGive <= available[mostExpendable]) //don't try to sell 0 resources
 				{
 				{
 					cb->trade(m, EMarketMode::RESOURCE_RESOURCE, GameResID(mostExpendable), GameResID(mostWanted), toGive);
 					cb->trade(m, EMarketMode::RESOURCE_RESOURCE, GameResID(mostExpendable), GameResID(mostWanted), toGive);
-					logAi->debug("Traded %d of %s for %d of %s at %s", toGive, mostExpendable, toGet, mostWanted, obj->getObjectName());
+					logAi->info("Traded %d of %s for %d of %s at %s", toGive, mostExpendable, toGet, mostWanted, obj->getObjectName());
 					haveTraded = true;
 					haveTraded = true;
 					shouldTryToTrade = true;
 					shouldTryToTrade = true;
 				}
 				}