Browse Source

Merge pull request #5678 from kdmcser/crash_fix2

fix crash when opening available artifacts popup for a slot
Ivan Savenko 5 months ago
parent
commit
34dce8dfc1
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/entities/artifact/CArtifact.cpp

+ 2 - 0
lib/entities/artifact/CArtifact.cpp

@@ -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