1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.

Replaced const TBonusListPtr with TConstBonusListPtr where necessary
Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary.
Removed superfluous use of const.
Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
This commit is contained in:
John Bolton
2020-09-30 22:55:41 -07:00
parent a54626459d
commit 6d8f1e4530
26 changed files with 88 additions and 87 deletions

View File

@ -1897,8 +1897,8 @@ UpgradeInfo CGameState::getUpgradeInfo(const CStackInstance &stack)
t = static_cast<const CGTownInstance *>(stack.armyObj);
else if(h)
{ //hero specialty
TBonusListPtr lista = h->getBonuses(Selector::typeSubtype(Bonus::SPECIAL_UPGRADE, base->idNumber));
for(const std::shared_ptr<Bonus> it : *lista)
TConstBonusListPtr lista = h->getBonuses(Selector::typeSubtype(Bonus::SPECIAL_UPGRADE, base->idNumber));
for(const auto & it : *lista)
{
auto nid = CreatureID(it->additionalInfo[0]);
if (nid != base->idNumber) //in very specific case the upgrade is available by default (?)