From 0f93b0991ca7992b5265954e628ef20b57ec63b1 Mon Sep 17 00:00:00 2001 From: SoundSSGood <87084363+SoundSSGood@users.noreply.github.com> Date: Mon, 13 Feb 2023 12:56:23 +0200 Subject: [PATCH] Regression fixed --- client/NetPacksClient.cpp | 5 +++-- client/widgets/CArtifactHolder.cpp | 7 ++++--- lib/CArtHandler.cpp | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 134c5ac9f..1565d95bc 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -294,8 +294,9 @@ void BulkMoveArtifacts::applyCl(CClient * cl) { auto srcLoc = ArtifactLocation(srcArtHolder, slotToMove.srcPos); auto dstLoc = ArtifactLocation(dstArtHolder, slotToMove.dstPos); - MoveArtifact ma(&srcLoc, &dstLoc, false); - ma.applyCl(cl); + callInterfaceIfPresent(cl, srcLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc); + if(srcLoc.owningPlayer() != dstLoc.owningPlayer()) + callInterfaceIfPresent(cl, dstLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc); } }; diff --git a/client/widgets/CArtifactHolder.cpp b/client/widgets/CArtifactHolder.cpp index b0f05ab26..a2c7eb81d 100644 --- a/client/widgets/CArtifactHolder.cpp +++ b/client/widgets/CArtifactHolder.cpp @@ -752,9 +752,10 @@ void CArtifactsOfHero::artifactMoved(const ArtifactLocation & src, const Artifac assert(commonInfo->src.AOH); CCS->curh->dragAndDropCursor("artifact", dst.getArt()->artType->getIconIndex()); } - auto art = dst.getArt(); - if(art && dst.slot == ArtifactPosition::TRANSITION_POS) - markPossibleSlots(art); + if(!curHero->artifactsTransitionPos.empty()) + { + markPossibleSlots(curHero->getArt(ArtifactPosition::TRANSITION_POS)); + } } updateParentWindow(); diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index 325791f6f..d5ea28531 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -1027,6 +1027,8 @@ bool CCombinedArtifactInstance::canBePutAt(const CArtifactSet * artSet, Artifact { if(slot == ArtifactPosition::TRANSITION_POS) return true; + if(!CArtifactInstance::canBePutAt(artSet, slot, assumeDestRemoved)) + return false; if(ArtifactUtils::isSlotBackpack(slot)) return true; //we can always remove combined art to the backapck