1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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

@@ -51,7 +51,7 @@ void QuickRecruitmentWindow::setCreaturePurchaseCards()
{
int availableAmount = getAvailableCreatures();
Point position = Point((pos.w - 100*availableAmount - 8*(availableAmount-1))/2,64);
for (int i = 0; i < GameConstants::CREATURES_PER_TOWN; i++)
for (int i = 0; i < town->town->creatures.size(); i++)
{
if(!town->town->creatures.at(i).empty() && !town->creatures.at(i).second.empty() && town->creatures[i].first)
{
@@ -120,7 +120,7 @@ void QuickRecruitmentWindow::purchaseUnits()
int QuickRecruitmentWindow::getAvailableCreatures()
{
int creaturesAmount = 0;
for (int i=0; i< GameConstants::CREATURES_PER_TOWN; i++)
for (int i=0; i< town->town->creatures.size(); i++)
if(!town->town->creatures.at(i).empty() && !town->creatures.at(i).second.empty() && town->creatures[i].first)
creaturesAmount++;
return creaturesAmount;