1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Merge pull request #5678 from kdmcser/crash_fix2

fix crash when opening available artifacts popup for a slot
This commit is contained in:
Ivan Savenko
2025-05-05 16:10:41 +03:00
committed by GitHub

View File

@@ -207,6 +207,8 @@ bool CArtifact::canBePutAt(const CArtifactSet * artSet, ArtifactPosition slot, b
auto possibleSlot = ArtifactUtils::getArtAnyPosition(&fittingSet, art->getId());
if(ArtifactUtils::isSlotEquipment(possibleSlot))
{
if (fittingSet.getSlot(possibleSlot) == nullptr)
fittingSet.artifactsWorn.insert(std::make_pair(possibleSlot, ArtSlotInfo(fittingSet.cb)));
fittingSet.lockSlot(possibleSlot);
}
else