1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #2556 from SoundSSGood/altar-fix

altar "sacrifice all" fix
This commit is contained in:
Ivan Savenko
2023-08-11 17:06:17 +03:00
committed by GitHub

View File

@@ -1262,11 +1262,14 @@ void CAltarWindow::SacrificeAll()
} }
else else
{ {
for(const auto & aw : arts->visibleArtSet.artifactsWorn) std::vector<ConstTransitivePtr<CArtifactInstance>> artsForMove;
for(const auto& slotInfo : arts->visibleArtSet.artifactsWorn)
{ {
if(!aw.second.locked) if(!slotInfo.second.locked && slotInfo.second.artifact->artType->isTradable())
moveArtToAltar(nullptr, aw.second.artifact); artsForMove.push_back(slotInfo.second.artifact);
} }
for(auto artInst : artsForMove)
moveArtToAltar(nullptr, artInst);
arts->updateWornSlots(); arts->updateWornSlots();
SacrificeBackpack(); SacrificeBackpack();
} }