From a5ebcd0f60c6bff0c18fee7d058c113f9c90ac07 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Sat, 14 Feb 2015 20:24:18 +0300 Subject: [PATCH] fix #2080. No more articaft exchange between heroes in kingdom overview. --- client/windows/CKingdomInterface.cpp | 9 +++------ client/windows/CKingdomInterface.h | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index 89687e364..cd0bb02ba 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -707,8 +707,7 @@ CIntObject* CKingdHeroList::createHeroItem(size_t index) if (index < heroesCount) { - auto hero = new CHeroItem(LOCPLINT->cb->getHeroBySerial(index, false), &artsCommonPart); - artsCommonPart.participants.insert(hero->heroArts); + auto hero = new CHeroItem(LOCPLINT->cb->getHeroBySerial(index, false)); artSets.push_back(hero->heroArts); return hero; } @@ -723,7 +722,6 @@ void CKingdHeroList::destroyHeroItem(CIntObject *object) if (CHeroItem * hero = dynamic_cast(object)) { artSets.erase(std::find(artSets.begin(), artSets.end(), hero->heroArts)); - artsCommonPart.participants.erase(hero->heroArts); } delete object; } @@ -862,7 +860,7 @@ public: } }; -CHeroItem::CHeroItem(const CGHeroInstance* Hero, CArtifactsOfHero::SCommonPart * artsCommonPart): +CHeroItem::CHeroItem(const CGHeroInstance* Hero): hero(Hero) { OBJ_CONSTRUCTION_CAPTURING_ALL; @@ -908,8 +906,7 @@ CHeroItem::CHeroItem(const CGHeroInstance* Hero, CArtifactsOfHero::SCommonPart * }; - heroArts = new CArtifactsOfHero(arts, backpack->arts, backpack->btnLeft, backpack->btnRight, false); - heroArts->commonInfo = artsCommonPart; + heroArts = new CArtifactsOfHero(arts, backpack->arts, backpack->btnLeft, backpack->btnRight, true); heroArts->setHero(hero); artsTabs = new CTabbedInt(std::bind(&CHeroItem::onTabSelected, this, _1), std::bind(&CHeroItem::onTabDeselected, this, _1)); diff --git a/client/windows/CKingdomInterface.h b/client/windows/CKingdomInterface.h index f4f6f5e53..eb0f37db1 100644 --- a/client/windows/CKingdomInterface.h +++ b/client/windows/CKingdomInterface.h @@ -307,15 +307,13 @@ class CHeroItem : public CIntObject, public CWindowWithGarrison public: CArtifactsOfHero *heroArts; - CHeroItem(const CGHeroInstance* hero, CArtifactsOfHero::SCommonPart * artsCommonPart); + CHeroItem(const CGHeroInstance* hero); }; /// Tab with all hero-specific data class CKingdHeroList : public CIntObject, public CGarrisonHolder, public CWindowWithArtifacts { private: - CArtifactsOfHero::SCommonPart artsCommonPart; - std::vector heroItems; CListBox * heroes; CPicture * title;