mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
Do not allow stopping movement while using water walk over water
This commit is contained in:
parent
0f4f9b3233
commit
2e411eca19
@ -2025,13 +2025,13 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
|
|||||||
|
|
||||||
auto canStop = [&](CGPathNode * node) -> bool
|
auto canStop = [&](CGPathNode * node) -> bool
|
||||||
{
|
{
|
||||||
if (node->layer == EPathfindingLayer::LAND || node->layer == EPathfindingLayer::SAIL)
|
if (node->layer != EPathfindingLayer::LAND && node->layer != EPathfindingLayer::SAIL)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
if (node->accessible == EPathAccessibility::ACCESSIBLE)
|
if (node->accessible != EPathAccessibility::ACCESSIBLE)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i=(int)path.nodes.size()-1; i>0 && (stillMoveHero.data == CONTINUE_MOVE || !canStop(&path.nodes[i])); i--)
|
for (i=(int)path.nodes.size()-1; i>0 && (stillMoveHero.data == CONTINUE_MOVE || !canStop(&path.nodes[i])); i--)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user