1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

introduce toResourceType

This commit is contained in:
Laserlicht
2025-09-15 00:08:18 +02:00
parent acd067e587
commit d808bd6412
34 changed files with 160 additions and 102 deletions

View File

@@ -259,7 +259,7 @@ ResourceSet NewTurnProcessor::generatePlayerIncome(PlayerColor playerID, bool ne
// Distribute weekly bonuses over 7 days, depending on the current day of the week
for (GameResID i : LIBRARY->resourceTypeHandler->getAllObjects())
{
const std::string & name = LIBRARY->resourceTypeHandler->getById(i)->getJsonKey();
const std::string & name = i.toResource()->getJsonKey();
int64_t weeklyBonus = difficultyConfig[name].Integer();
int64_t dayOfWeek = gameHandler->gameState().getDate(Date::DAY_OF_WEEK);
int64_t dailyIncome = incomeHandicapped[i];