1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-18 03:21:27 +02:00

Merge pull request from Laserlicht/patch-3

8th creature fix
This commit is contained in:
Ivan Savenko 2024-11-06 22:02:06 +02:00 committed by GitHub
commit 92fc66d1c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,7 +238,8 @@ std::string CBuildingRect::getSubtitle()//hover text for building
return town->getTown()->buildings.at(getBuilding()->bid)->getNameTranslated();
else//dwellings - recruit %creature%
{
auto & availableCreatures = town->creatures[(bid-30)%town->getTown()->creatures.size()].second;
int level = BuildingID::getLevelFromDwelling(getBuilding()->bid);
auto & availableCreatures = town->creatures[level].second;
if(availableCreatures.size())
{
int creaID = availableCreatures.back();//taking last of available creatures