浏览代码

Update client/windows/CCastleInterface.cpp

Co-Authored-By: Ivan Savenko <[email protected]>
Laserlicht 9 月之前
父节点
当前提交
c44b91de45
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      client/windows/CCastleInterface.cpp

+ 4 - 4
client/windows/CCastleInterface.cpp

@@ -235,9 +235,9 @@ std::string CBuildingRect::getSubtitle()//hover text for building
 	if (!getBuilding())
 		return "";
 
-	int bid = getBuilding()->bid;
+	auto bid = getBuilding()->bid;
 
-	if (bid<30)//non-dwellings - only building name
+	if (!bid.IsDwelling())//non-dwellings - only building name
 		return town->getTown()->buildings.at(getBuilding()->bid)->getNameTranslated();
 	else//dwellings - recruit %creature%
 	{
@@ -660,13 +660,13 @@ void CCastleBuildings::drawOverlays(Canvas & to, std::vector<std::shared_ptr<CBu
 		auto building = buildingRect->getBuilding();
 		if (!building)
 			continue;
-		int bid = building->bid;
+		auto bid = building->bid;
 
 		auto overlay = town->getTown()->buildings.at(bid)->getNameTranslated();
 		const auto & font = GH.renderHandler().loadFont(FONT_TINY);
 
 		auto backColor = Colors::GREEN; // Other
-		if(bid >= 30)
+		if(bid.IsDwelling())
 			backColor = Colors::PURPLE; // dwelling
 
 		auto contentRect = buildingRect->border->contentRect();