Pārlūkot izejas kodu

fixed regression

SoundSSGood 1 gadu atpakaļ
vecāks
revīzija
4df7de36c1

+ 2 - 0
client/widgets/markets/CAltarCreatures.cpp

@@ -51,6 +51,8 @@ CAltarCreatures::CAltarCreatures(const IMarket * market, const CGHeroInstance *
 	assert(leftTradePanel);
 	leftTradePanel->moveBy(Point(45, 110));
 	leftTradePanel->updateSlotsCallback = std::bind(&CCreaturesSelling::updateSubtitle, this);
+	for(const auto & slot : leftTradePanel->slots)
+		slot->clickPressedCallback = [this](const std::shared_ptr<CTradeableItem> & heroSlot) {CAltarCreatures::onSlotClickPressed(heroSlot, hLeft);};
 
 	// Altar creatures panel
 	rightTradePanel = std::make_shared<CreaturesPanel>([this](const std::shared_ptr<CTradeableItem> & altarSlot)

+ 1 - 4
client/widgets/markets/CTradeBase.cpp

@@ -90,10 +90,7 @@ CCreaturesSelling::CCreaturesSelling()
 		if(const auto & creature = hero->getCreature(slotId))
 			slots.emplace_back(std::make_tuple(creature->getId(), slotId, hero->getStackCount(slotId)));
 	}
-	leftTradePanel = std::make_shared<CreaturesPanel>([this](const std::shared_ptr<CTradeableItem> & altarSlot)
-		{
-			CTradeBase::onSlotClickPressed(altarSlot, hLeft);
-		}, slots);
+	leftTradePanel = std::make_shared<CreaturesPanel>(nullptr, slots);
 }
 
 bool CCreaturesSelling::slotDeletingCheck(const std::shared_ptr<CTradeableItem> & slot)