diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 0daa2bd96..796a9cf45 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1906,12 +1906,10 @@ const CBuilding * CFortScreen::RecruitArea::getMyBuilding() return nullptr; const CBuilding * build = town->town->buildings.at(myID); - while (town->town->buildings.count(myID)) - { - if (town->hasBuilt(myID)) - build = town->town->buildings.at(myID); - myID.advance(town->town->creatures.size()); - } + myID = BuildingID::getDwellingFromLevel(level, 1); + if (town->hasBuilt(myID)) + build = town->town->buildings.at(myID); + return build; }