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

Show Seer Hut quest icon on right click. Fix broken tooltip.

This commit is contained in:
Ivan Savenko
2023-11-02 15:50:24 +02:00
parent 1ebb151b41
commit c1c2119f3d
3 changed files with 36 additions and 2 deletions

View File

@@ -187,14 +187,14 @@ void Rewardable::Limiter::loadComponents(std::vector<Component> & comps,
const CGHeroInstance * h) const
{
if (heroExperience)
comps.emplace_back(ComponentType::EXPERIENCE, static_cast<si32>(h->calculateXp(heroExperience)));
comps.emplace_back(ComponentType::EXPERIENCE, static_cast<si32>(h ? h->calculateXp(heroExperience) : heroExperience));
if (heroLevel > 0)
comps.emplace_back(ComponentType::EXPERIENCE, heroLevel);
if (manaPoints || manaPercentage > 0)
{
int absoluteMana = h->manaLimit() ? (manaPercentage * h->mana / h->manaLimit() / 100) : 0;
int absoluteMana = (h && h->manaLimit()) ? (manaPercentage * h->mana / h->manaLimit() / 100) : 0;
comps.emplace_back(ComponentType::MANA, absoluteMana + manaPoints);
}