1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Do not allow stopping movement while using water walk over water

This commit is contained in:
Ivan Savenko
2023-08-31 01:38:16 +03:00
parent 55af9ed5a0
commit 64adb538fe

View File

@@ -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--)