Browse Source

crash fixed

SoundSSGood 2 years ago
parent
commit
20d86edbd1
2 changed files with 2 additions and 3 deletions
  1. 1 1
      lib/CArtHandler.cpp
  2. 1 2
      lib/CCreatureSet.cpp

+ 1 - 1
lib/CArtHandler.cpp

@@ -1110,7 +1110,7 @@ void CArtifactSet::putArtifact(ArtifactPosition slot, CArtifactInstance * art)
 					part.slot = ArtifactUtils::getArtAnyPosition(this, part.art->getTypeId());
 
 				assert(ArtifactUtils::isSlotEquipment(part.slot));
-				setNewArtSlot(part.slot, art, true);
+				setNewArtSlot(part.slot, part.art, true);
 			}
 		}
 	}

+ 1 - 2
lib/CCreatureSet.cpp

@@ -882,9 +882,8 @@ void CStackInstance::removeArtifact(ArtifactPosition pos)
 {
 	assert(getArt(pos));
 
+	detachFrom(*getArt(pos));
 	CArtifactSet::removeArtifact(pos);
-	if(ArtifactUtils::isSlotEquipment(pos))
-		detachFrom(*getArt(pos));
 }
 
 void CStackInstance::serializeJson(JsonSerializeFormat & handler)