1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-29 21:56:54 +02:00

Fix removal of fully sacrificed stacks from heroes garrison slots

This one fixes issue 2010. Though CAltarWindow need proper refactoring.
This commit is contained in:
ArseniyShestakov 2014-12-26 01:18:58 +03:00
parent aca0eeed86
commit 27705e1ac6

View File

@ -1201,8 +1201,11 @@ void CAltarWindow::getBaseForPositions(EType type, int &dx, int &dy, int &x, int
void CAltarWindow::sliderMoved(int to) void CAltarWindow::sliderMoved(int to)
{ {
sacrificedUnits[hLeft->serial] = to; if(hLeft)
updateRight(hRight); sacrificedUnits[hLeft->serial] = to;
if(hRight)
updateRight(hRight);
deal->block(!to); deal->block(!to);
calcTotalExp(); calcTotalExp();
redraw(); redraw();
@ -1356,13 +1359,7 @@ void CAltarWindow::garrisonChanged()
std::set<CTradeableItem *> empty; std::set<CTradeableItem *> empty;
getEmptySlots(empty); getEmptySlots(empty);
for(CTradeableItem *t : empty) removeItems(empty);
{
removeItem(*std::find_if(items[0].begin(), items[0].end(), [&](const CTradeableItem * item)
{
return item->serial == t->serial;
}));
}
initSubs(true); initSubs(true);
getExpValues(); getExpValues();