1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

replaced constant

This commit is contained in:
Laserlicht
2024-08-05 23:03:19 +02:00
parent 1a06a2cc44
commit 3afddbbf29
10 changed files with 31 additions and 25 deletions

View File

@@ -2362,8 +2362,8 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
{
if(buildingID >= BuildingID::DWELL_FIRST) //dwelling
{
int level = (buildingID - BuildingID::DWELL_FIRST) % GameConstants::CREATURES_PER_TOWN;
int upgradeNumber = (buildingID - BuildingID::DWELL_FIRST) / GameConstants::CREATURES_PER_TOWN;
int level = (buildingID - BuildingID::DWELL_FIRST) % t->town->creatures.size();
int upgradeNumber = (buildingID - BuildingID::DWELL_FIRST) / t->town->creatures.size();
if(upgradeNumber >= t->town->creatures.at(level).size())
{