瀏覽代碼

Fixed check for free slots when recruiting in towns

Ivan Savenko 1 年之前
父節點
當前提交
ea8995e901
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 2 2
      client/windows/CCastleInterface.cpp
  2. 1 1
      client/windows/GUIClasses.cpp

+ 2 - 2
client/windows/CCastleInterface.cpp

@@ -901,7 +901,7 @@ void CCastleBuildings::enterDwelling(int level)
 	{
 	{
 		LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
 		LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
 	};
 	};
-	GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town, recruitCb, nullptr, -87);
+	GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town->getUpperArmy(), recruitCb, nullptr, -87);
 }
 }
 
 
 void CCastleBuildings::enterToTheQuickRecruitmentWindow()
 void CCastleBuildings::enterToTheQuickRecruitmentWindow()
@@ -1110,7 +1110,7 @@ void CCreaInfo::clickPressed(const Point & cursorPosition)
 	{
 	{
 		LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
 		LOCPLINT->cb->recruitCreatures(town, town->getUpperArmy(), id, count, level);
 	};
 	};
-	GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town, recruitCb, nullptr, offset);
+	GH.windows().createAndPushWindow<CRecruitmentWindow>(town, level, town->getUpperArmy(), recruitCb, nullptr, offset);
 }
 }
 
 
 std::string CCreaInfo::genGrowthText()
 std::string CCreaInfo::genGrowthText()

+ 1 - 1
client/windows/GUIClasses.cpp

@@ -159,7 +159,7 @@ void CRecruitmentWindow::buy()
 		else
 		else
 		{
 		{
 			std::string txt;
 			std::string txt;
-			if(dst->ID == Obj::HERO)
+			if(dwelling->ID != Obj::TOWN)
 			{
 			{
 				txt = CGI->generaltexth->allTexts[425]; //The %s would join your hero, but there aren't enough provisions to support them.
 				txt = CGI->generaltexth->allTexts[425]; //The %s would join your hero, but there aren't enough provisions to support them.
 				boost::algorithm::replace_first(txt, "%s", slider->getValue() > 1 ? CGI->creh->objects[crid]->getNamePluralTranslated() : CGI->creh->objects[crid]->getNameSingularTranslated());
 				boost::algorithm::replace_first(txt, "%s", slider->getValue() > 1 ? CGI->creh->objects[crid]->getNamePluralTranslated() : CGI->creh->objects[crid]->getNameSingularTranslated());