From 47c8ee2e1324658438e4de7e36edaeb827731ef7 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sun, 26 Sep 2010 05:21:09 +0000 Subject: [PATCH] Statue of Legion constituents are now properly handled by GUI. --- client/CCastleInterface.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index b3dec258a..d844d60fe 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -1182,17 +1182,18 @@ void CCastleInterface::CCreaInfo::clickRight(tribool down, bool previousState) summ+=AddToString(CGI->generaltexth->allTexts[591],descr,cnt); const CGHeroInstance * ch = ci->town->garrisonHero; + BonusList bl; for (cnt = 0; cnt<2; cnt++) // "loop" to avoid copy-pasting code { if(ch) { - for(std::list::const_iterator i=ch->bonuses.begin(); i != ch->bonuses.end(); i++) - if(i->type == Bonus::CREATURE_GROWTH && i->subtype == level) - if (i->source == Bonus::ARTIFACT) - summ+=AddToString(CGI->arth->artifacts[i->id]->Name()+" %+d",descr,i->val); + ch->getBonuses(bl, Selector::type(Bonus::CREATURE_GROWTH) && Selector::subtype(level) && Selector::sourceType(Bonus::ARTIFACT), ch); }; ch = ci->town->visitingHero; }; + if (bl.size()) + summ+=AddToString (CGI->arth->artifacts[bl.front().id]->Name()+" %+d", descr, bl.totalValue()); + //TODO: player bonuses if(bld.find(26)!=bld.end()) //grail - +50% to ALL growth