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

Removed pointer to VLC entity from CStackBasicDescriptor

This commit is contained in:
Ivan Savenko
2024-10-12 16:02:35 +00:00
parent c98ac01e7a
commit d3af9f1c67
38 changed files with 140 additions and 160 deletions

View File

@ -1152,7 +1152,7 @@ void CGSirens::onHeroVisit( const CGHeroInstance * h ) const
if(drown)
{
cb->changeStackCount(StackLocation(h, i->first), -drown);
xp += drown * i->second->type->getMaxHealth();
xp += drown * i->second->getType()->getMaxHealth();
}
}
@ -1318,7 +1318,7 @@ void HillFort::onHeroVisit(const CGHeroInstance * h) const
void HillFort::fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack) const
{
int32_t level = stack.type->getLevel();
int32_t level = stack.getType()->getLevel();
int32_t index = std::clamp<int32_t>(level - 1, 0, upgradeCostPercentage.size() - 1);
int costModifier = upgradeCostPercentage[index];
@ -1326,10 +1326,10 @@ void HillFort::fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack)
if (costModifier < 0)
return; // upgrade not allowed
for(const auto & nid : stack.type->upgrades)
for(const auto & nid : stack.getCreature()->upgrades)
{
info.newID.push_back(nid);
info.cost.push_back((nid.toCreature()->getFullRecruitCost() - stack.type->getFullRecruitCost()) * costModifier / 100);
info.cost.push_back((nid.toCreature()->getFullRecruitCost() - stack.getType()->getFullRecruitCost()) * costModifier / 100);
}
}