浏览代码

Merge pull request #5678 from kdmcser/crash_fix2

fix crash when opening available artifacts popup for a slot
Ivan Savenko 5 月之前
父节点
当前提交
34dce8dfc1
共有 1 个文件被更改,包括 2 次插入0 次删除
  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