diff --git a/client/widgets/CWindowWithArtifacts.cpp b/client/widgets/CWindowWithArtifacts.cpp index a8b727ef6..f5252be94 100644 --- a/client/widgets/CWindowWithArtifacts.cpp +++ b/client/widgets/CWindowWithArtifacts.cpp @@ -148,7 +148,34 @@ void CWindowWithArtifacts::clickPressedArtPlaceHero(CArtifactsOfHeroBase & artsI { assert(artSetPtr->getHero()->getSlotByInstance(art) != ArtifactPosition::PRE_FIRST); - if(GH.isKeyboardAltDown()) + if(GH.isKeyboardCtrlDown()) + { + std::shared_ptr anotherHeroEquipmentPointer = nullptr; + + for(auto set : artSets) + { + if(std::holds_alternative>(set)) + { + std::shared_ptr heroEquipmentPointer = std::get>(set).lock(); + if(heroEquipmentPointer->getHero()->id != artSetPtr->getHero()->id) + { + anotherHeroEquipmentPointer = heroEquipmentPointer; + break; + } + } + } + + if(anotherHeroEquipmentPointer != nullptr) + { + ArtifactPosition availablePosition = ArtifactUtils::getArtAnyPosition(anotherHeroEquipmentPointer->getHero(), art->getTypeId()); + if(availablePosition != ArtifactPosition::PRE_FIRST) + { + LOCPLINT->cb->swapArtifacts(ArtifactLocation(artSetPtr->getHero()->id, artSetPtr->getHero()->getSlotByInstance(art)), + ArtifactLocation(anotherHeroEquipmentPointer->getHero()->id, availablePosition)); + } + } + } + else if(GH.isKeyboardAltDown()) { ArtifactPosition destinationPosition = ArtifactPosition::PRE_FIRST;