diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 59c4ee89c..ac81ed403 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2720,16 +2720,9 @@ bool CGameHandler::moveArtifact(const ArtifactLocation & src, const ArtifactLoca ma.swap = true; } - try - { - auto hero = getHero(dst.artHolder); - if(ArtifactUtils::checkSpellbookIsNeeded(hero, srcArtifact->artType->getId(), dstSlot)) - giveHeroNewArtifact(hero, VLC->arth->objects[ArtifactID::SPELLBOOK], ArtifactPosition::SPELLBOOK); - } - catch(const std::bad_variant_access &) - { - // object other than hero received an art - ignore - } + auto hero = getHero(dst.artHolder); + if(ArtifactUtils::checkSpellbookIsNeeded(hero, srcArtifact->artType->getId(), dstSlot)) + giveHeroNewArtifact(hero, VLC->arth->objects[ArtifactID::SPELLBOOK], ArtifactPosition::SPELLBOOK); ma.artsPack0.push_back(BulkMoveArtifacts::LinkedSlots(src.slot, dstSlot)); if(src.artHolder != dst.artHolder) diff --git a/test/mock/mock_IGameCallback.h b/test/mock/mock_IGameCallback.h index a772469fe..48a2fb639 100644 --- a/test/mock/mock_IGameCallback.h +++ b/test/mock/mock_IGameCallback.h @@ -67,8 +67,7 @@ public: void removeAfterVisit(const CGObjectInstance *object) override {} //object will be destroyed when interaction is over. Do not call when interaction is not ongoing! bool giveHeroNewArtifact(const CGHeroInstance * h, const CArtifact * artType, ArtifactPosition pos) override {return false;} - bool giveHeroArtifact(const CGHeroInstance * h, const CArtifactInstance * a, ArtifactPosition pos) override {return false;} - void putArtifact(const ArtifactLocation &al, const CArtifactInstance *a) override {} + bool putArtifact(const ArtifactLocation & al, const CArtifactInstance * art, std::optional askAssemble) override {return false;} void removeArtifact(const ArtifactLocation &al) override {} bool moveArtifact(const ArtifactLocation &al1, const ArtifactLocation &al2) override {return false;}