浏览代码

check availability only of town creatures

QRD shows only town creatures ignoring Summoning Portal
Andrey Filipenkov 3 年之前
父节点
当前提交
90d355dd05
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      client/windows/CCastleInterface.cpp

+ 5 - 1
client/windows/CCastleInterface.cpp

@@ -842,7 +842,11 @@ void CCastleBuildings::enterDwelling(int level)
 
 void CCastleBuildings::enterToTheQuickRecruitmentWindow()
 {
-	const auto hasSomeoneToRecruit = std::any_of(town->creatures.cbegin(), town->creatures.cend(),
+	const auto beginIt = town->creatures.cbegin();
+	const auto afterLastIt = town->creatures.size() > GameConstants::CREATURES_PER_TOWN
+		? std::next(beginIt, GameConstants::CREATURES_PER_TOWN)
+		: town->creatures.cend();
+	const auto hasSomeoneToRecruit = std::any_of(beginIt, afterLastIt,
 		[](const auto & creatureInfo) { return creatureInfo.first > 0; });
 	if(hasSomeoneToRecruit)
 		GH.pushIntT<QuickRecruitmentWindow>(town, pos);