diff --git a/client/windows/CHeroWindow.cpp b/client/windows/CHeroWindow.cpp index 5c9b1dd6b..1f194bcf4 100644 --- a/client/windows/CHeroWindow.cpp +++ b/client/windows/CHeroWindow.cpp @@ -319,9 +319,12 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded) void CHeroWindow::dismissCurrent() { - CFunctionList ony = [=](){ close(); }; - ony += [=](){ LOCPLINT->cb->dismissHero(curHero); }; - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], ony, nullptr); + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], [this]() + { + arts->putBackPickedArtifact(); + close(); + LOCPLINT->cb->dismissHero(curHero); + }, nullptr); } void CHeroWindow::createBackpackWindow()