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

calculate income

This commit is contained in:
Laserlicht
2024-07-25 02:51:00 +02:00
parent 63b8ac1a58
commit bfd1e8a7c8
8 changed files with 33 additions and 19 deletions

View File

@@ -215,6 +215,10 @@ TResources CGTownInstance::dailyIncome() const
ret += p.second->produce;
}
}
auto playerSettings = cb->gameState()->scenarioOps->getIthPlayersSettings(getOwner());
for(TResources::nziterator it(ret); it.valid(); it++)
ret[it->resType] = ret[it->resType] * playerSettings.handicap.percentIncome / 100;
return ret;
}