From fe3e63533265801c3a6cb0c9eac7166c6ada0dea Mon Sep 17 00:00:00 2001 From: SoundSSGood <87084363+SoundSSGood@users.noreply.github.com> Date: Sun, 7 May 2023 00:59:44 +0300 Subject: [PATCH] assertions fix --- client/widgets/CWindowWithArtifacts.cpp | 3 +-- lib/NetPacksLib.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/widgets/CWindowWithArtifacts.cpp b/client/widgets/CWindowWithArtifacts.cpp index 01eca2323..3bb776980 100644 --- a/client/widgets/CWindowWithArtifacts.cpp +++ b/client/widgets/CWindowWithArtifacts.cpp @@ -229,8 +229,7 @@ void CWindowWithArtifacts::artifactMoved(const ArtifactLocation & srcLoc, const // we have a different artifact may look surprising... but it's valid. auto pickedArtInst = std::get(curState.value()); - assert(srcLoc.isHolder(std::get(curState.value()))); - assert(srcLoc.getArt() == pickedArtInst); + assert(!pickedArtInst || destLoc.isHolder(std::get(curState.value()))); auto artifactMovedBody = [this, withRedraw, &srcLoc, &destLoc, &pickedArtInst](auto artSetWeak) -> void { diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 9192beb83..04ddb1088 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -1835,9 +1835,7 @@ void EraseArtifact::applyGs(CGameState *gs) void MoveArtifact::applyGs(CGameState * gs) { CArtifactInstance * art = src.getArt(); - if(!ArtifactUtils::isSlotBackpack(dst.slot)) - assert(!dst.getArt()); - + assert(!ArtifactUtils::isSlotEquipment(dst.slot) || !dst.getArt()); art->move(src, dst); }