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:
@ -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 (?)
|
||||
|
Reference in New Issue
Block a user