1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge remote-tracking branch 'vcmi/master' into develop

This commit is contained in:
Ivan Savenko
2024-07-11 15:59:55 +00:00
96 changed files with 4648 additions and 4084 deletions

View File

@ -348,7 +348,12 @@ std::vector<Component> CRewardableObject::getPopupComponentsImpl(PlayerColor pla
auto rewardIndices = getAvailableRewards(hero, Rewardable::EEventType::EVENT_FIRST_VISIT);
if (rewardIndices.empty() && !configuration.info.empty())
rewardIndices.push_back(0);
{
// Object has valid config, but current hero has no rewards that he can receive.
// Usually this happens if hero has already visited this object -> show reward using context without any hero
// since reward may be context-sensitive - e.g. Witch Hut that gives 1 skill, but always at basic level
return loadComponents(nullptr, {0});
}
if (rewardIndices.empty())
return {};