From 20d86edbd1b332e3a1ce081f52f836168f40875a Mon Sep 17 00:00:00 2001 From: SoundSSGood <87084363+SoundSSGood@users.noreply.github.com> Date: Sat, 24 Jun 2023 17:50:58 +0300 Subject: [PATCH] crash fixed --- lib/CArtHandler.cpp | 2 +- lib/CCreatureSet.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index f8993b1f5..851d851ec 100644 --- a/lib/CArtHandler.cpp +++ b/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); } } } diff --git a/lib/CCreatureSet.cpp b/lib/CCreatureSet.cpp index e69834738..93370fa85 100644 --- a/lib/CCreatureSet.cpp +++ b/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)