From 64adb538fe8a9f6c23f965da8d3c5e1a1f03ad36 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 31 Aug 2023 01:38:16 +0300 Subject: [PATCH] Do not allow stopping movement while using water walk over water --- client/CPlayerInterface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index ef8dfc055..824b97b07 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -2007,13 +2007,13 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path) auto canStop = [&](CGPathNode * node) -> bool { - if (node->layer == EPathfindingLayer::LAND || node->layer == EPathfindingLayer::SAIL) - return true; + if (node->layer != EPathfindingLayer::LAND && node->layer != EPathfindingLayer::SAIL) + return false; - if (node->accessible == EPathAccessibility::ACCESSIBLE) - return true; + if (node->accessible != EPathAccessibility::ACCESSIBLE) + return false; - return false; + return true; }; for (i=(int)path.nodes.size()-1; i>0 && (stillMoveHero.data == CONTINUE_MOVE || !canStop(&path.nodes[i])); i--)