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

Reduce usage of implicit conversions to int

This commit is contained in:
Ivan Savenko
2025-04-19 16:12:07 +03:00
parent 4d57a8ed36
commit 829739da24
64 changed files with 220 additions and 200 deletions

View File

@@ -257,7 +257,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 : GameResID::ALL_RESOURCES())
{
const std::string & name = GameConstants::RESOURCE_NAMES[i];
const std::string & name = GameConstants::RESOURCE_NAMES[i.getNum()];
int64_t weeklyBonus = difficultyConfig[name].Integer();
int64_t dayOfWeek = gameHandler->gameState().getDate(Date::DAY_OF_WEEK);
int64_t dailyIncome = incomeHandicapped[i];
@@ -552,8 +552,7 @@ std::tuple<EWeekType, CreatureID> NewTurnProcessor::pickWeekType(bool newMonth)
do
{
newMonster.second = LIBRARY->creh->pickRandomMonster(gameHandler->getRandomGenerator());
} while (LIBRARY->creh->objects[newMonster.second] &&
(*LIBRARY->townh)[LIBRARY->creatures()->getById(newMonster.second)->getFactionID()]->town == nullptr); // find first non neutral creature
} while (newMonster.second.toEntity(LIBRARY)->getFactionID().toFaction()->town == nullptr); // find first non neutral creature
return { EWeekType::BONUS_GROWTH, newMonster.second};
}