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

@@ -471,7 +471,7 @@ int32_t getArtifactBonusScoreImpl(const std::shared_ptr<Bonus> & bonus)
case BonusType::UNDEAD_RAISE_PERCENTAGE:
return bonus->val * 400;
case BonusType::GENERATE_RESOURCE:
return bonus->val * LIBRARY->resourceTypeHandler->getById(bonus->subtype.as<GameResID>())->getPrice() * 10;
return bonus->val * bonus->subtype.as<GameResID>().toResource()->getPrice() * 10;
case BonusType::SPELL_DURATION:
return bonus->val * 200;
case BonusType::MAGIC_RESISTANCE: