1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Some partial success on getting fly to work similarly to SoD

This commit is contained in:
Dydzio 2024-01-18 20:42:08 +01:00
parent f6e0f46040
commit 440b468e27
2 changed files with 17 additions and 6 deletions

View File

@ -29,7 +29,7 @@ PathfinderOptions::PathfinderOptions()
, useCastleGate(false)
, lightweightFlyingMode(false)
, oneTurnSpecialLayersLimit(true)
, originalMovementRules(false)
, originalMovementRules(true)
, turnLimit(std::numeric_limits<uint8_t>::max())
, canUseCast(false)
{

View File

@ -384,12 +384,23 @@ void LayerTransitionRule::process(
case EPathfindingLayer::AIR:
if(pathfinderConfig->options.originalMovementRules)
{
if((source.node->accessible != EPathAccessibility::ACCESSIBLE &&
source.node->accessible != EPathAccessibility::VISITABLE) &&
(destination.node->accessible != EPathAccessibility::VISITABLE &&
destination.node->accessible != EPathAccessibility::ACCESSIBLE))
if(destination.coord.x == 2 && destination.coord.y == 35)
logGlobal->error(source.node->coord.toString() + std::string(" Layer: ") + std::to_string(destination.node->layer) + std::string(" Accessibility: ") + std::to_string((int)source.node->accessible));
if(source.node->accessible != EPathAccessibility::ACCESSIBLE &&
source.node->accessible != EPathAccessibility::VISITABLE &&
destination.node->accessible != EPathAccessibility::VISITABLE &&
destination.node->accessible != EPathAccessibility::ACCESSIBLE)
{
destination.blocked = true;
if(destination.node->accessible == EPathAccessibility::BLOCKVIS)
{
if(source.nodeObject || source.tile->blocked)
{
destination.blocked = true;
}
}
else
destination.blocked = true;
}
}
else if(destination.node->accessible != EPathAccessibility::ACCESSIBLE)