diff --git a/client/HeroMovementController.cpp b/client/HeroMovementController.cpp index 6b1152f60..89b5153b2 100644 --- a/client/HeroMovementController.cpp +++ b/client/HeroMovementController.cpp @@ -22,6 +22,7 @@ #include "../CCallback.h" +#include "../lib/CondSh.h" #include "../lib/pathfinder/CGPathNode.h" #include "../lib/mapObjects/CGHeroInstance.h" #include "../lib/networkPacks/PacksForClient.h" @@ -233,7 +234,7 @@ void HeroMovementController::onMoveHeroApplied() assert(currentlyMovingHero); const auto * hero = currentlyMovingHero; - bool canMove = LOCPLINT->localState->hasPath(hero) && LOCPLINT->localState->getPath(hero).nextNode().turns == 0; + bool canMove = LOCPLINT->localState->hasPath(hero) && LOCPLINT->localState->getPath(hero).nextNode().turns == 0 && !LOCPLINT->showingDialog->get(); bool wantStop = stoppingMovement; bool canStop = !canMove || canHeroStopAtNode(LOCPLINT->localState->getPath(hero).currNode()); diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index caec81197..5bfb3b8e8 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -821,11 +821,11 @@ CTownItem::CTownItem(const CGTownInstance * Town) available.push_back(std::make_shared(Point(48+37*(int)i, 78), town, (int)i, true, false)); } - fastTownHall = std::make_shared(Point(69, 31), AnimationPath::builtin("castleInterfaceQuickAccessz"), CButton::tooltip(), [this]() { std::make_shared(town)->enterTownHall(); }); + fastTownHall = std::make_shared(Point(69, 31), AnimationPath::builtin("castleInterfaceQuickAccess"), CButton::tooltip(), [this]() { std::make_shared(town)->enterTownHall(); }); fastTownHall->setOverlay(std::make_shared(AnimationPath::builtin("ITMTL"), town->hallLevel())); int imageIndex = town->fortLevel() == CGTownInstance::EFortLevel::NONE ? 3 : town->fortLevel() - 1; - fastArmyPurchase = std::make_shared(Point(111, 31), AnimationPath::builtin("castleInterfaceQuickAccessz"), CButton::tooltip(), [this]() { std::make_shared(town)->enterToTheQuickRecruitmentWindow(); }); + fastArmyPurchase = std::make_shared(Point(111, 31), AnimationPath::builtin("castleInterfaceQuickAccess"), CButton::tooltip(), [this]() { std::make_shared(town)->enterToTheQuickRecruitmentWindow(); }); fastArmyPurchase->setOverlay(std::make_shared(AnimationPath::builtin("itmcl"), imageIndex)); fastTavern = std::make_shared(Rect(5, 6, 58, 64), [&]() diff --git a/client/windows/InfoWindows.cpp b/client/windows/InfoWindows.cpp index 59e95ea21..6f5fa1ad2 100644 --- a/client/windows/InfoWindows.cpp +++ b/client/windows/InfoWindows.cpp @@ -54,10 +54,7 @@ CSelWindow::CSelWindow( const std::string & Text, PlayerColor player, int charpe text = std::make_shared(Text, Rect(0, 0, 250, 100), 0, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE); if(buttons.size() > 1 && askID.getNum() >= 0) //cancel button functionality - { buttons.back()->addCallback([askID](){LOCPLINT->cb->selectionMade(0, askID);}); - //buttons.back()->addCallback(std::bind(&CCallback::selectionMade, LOCPLINT->cb.get(), 0, askID)); - } if(buttons.size() == 1) buttons.front()->assignedKey = EShortcut::GLOBAL_RETURN; @@ -69,7 +66,11 @@ CSelWindow::CSelWindow( const std::string & Text, PlayerColor player, int charpe } if(!comps.empty()) + { components = std::make_shared(comps, Rect(0,0,0,0)); + for (auto & comp : comps) + comp->onChoose = [this](){ madeChoiceAndClose(); }; + } CMessage::drawIWindow(this, Text, player); } diff --git a/lib/spells/AdventureSpellMechanics.cpp b/lib/spells/AdventureSpellMechanics.cpp index 8820f111c..bd5cbf188 100644 --- a/lib/spells/AdventureSpellMechanics.cpp +++ b/lib/spells/AdventureSpellMechanics.cpp @@ -538,7 +538,7 @@ ESpellCastResult TownPortalMechanics::applyAdventureEffects(SpellCastEnvironment const TerrainTile & from = env->getMap()->getTile(parameters.caster->getHeroCaster()->visitablePos()); const TerrainTile & dest = env->getMap()->getTile(destination->visitablePos()); - if(!dest.isClear(&from)) + if(!dest.entrableTerrain(&from)) { InfoWindow iw; iw.player = parameters.caster->getCasterOwner();