1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
This commit is contained in:
Laserlicht 2024-08-21 21:24:06 +02:00
parent c36a6427c2
commit 43fc741a15
2 changed files with 9 additions and 4 deletions

View File

@ -1910,10 +1910,7 @@ const CBuilding * CFortScreen::RecruitArea::getMyBuilding()
{ {
if (town->hasBuilt(myID)) if (town->hasBuilt(myID))
build = town->town->buildings.at(myID); build = town->town->buildings.at(myID);
if(myID != BuildingID::DWELL_LVL_8) BuildingID::advanceDwelling(myID);
myID.advance(GameConstants::CREATURES_PER_TOWN - 1);
else
myID = BuildingID::DWELL_LVL_8_UP;
} }
return build; return build;

View File

@ -352,6 +352,14 @@ public:
return (dwelling - DWELL_FIRST) / (GameConstants::CREATURES_PER_TOWN - 1); return (dwelling - DWELL_FIRST) / (GameConstants::CREATURES_PER_TOWN - 1);
} }
static void advanceDwelling(BuildingIDBase & dwelling)
{
if(dwelling != BuildingIDBase::DWELL_LVL_8)
dwelling.advance(GameConstants::CREATURES_PER_TOWN - 1);
else
dwelling.advance(1);
}
bool IsSpecialOrGrail() const bool IsSpecialOrGrail() const
{ {
return num == SPECIAL_1 || num == SPECIAL_2 || num == SPECIAL_3 || num == SPECIAL_4 || num == GRAIL; return num == SPECIAL_1 || num == SPECIAL_2 || num == SPECIAL_3 || num == SPECIAL_4 || num == GRAIL;