fix(Core/Travel): Soft-bias STEEP at regen PathGenerator sites

This commit is contained in:
bash 2026-05-30 18:07:02 +02:00
parent a460886c1c
commit 65bf6a0dff

View File

@ -720,9 +720,10 @@ std::vector<WorldPosition> WorldPosition::getPathStepFrom(WorldPosition startPos
PathGenerator path(pathUnit); PathGenerator path(pathUnit);
// Source is a temp Creature, so CreateFilter's bot block doesn't // Source is a temp Creature, so CreateFilter's bot block doesn't
// fire — apply the same bot rules here so generated paths match // fire — apply the same bot cost biases here so generated paths
// what bots can actually walk at runtime. // match what bots prefer at runtime (STEEP/water are reachable
path.SetExcludeFlags(NAV_GROUND_STEEP); // but not preferred).
path.SetNavTerrainCost(NAV_GROUND_STEEP, 5.0f);
path.SetNavTerrainCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
auto result = getPathStepFrom(startPos, path); auto result = getPathStepFrom(startPos, path);
@ -857,8 +858,8 @@ std::vector<WorldPosition> WorldPosition::getPathFromPath(std::vector<WorldPosit
PathGenerator path(pathUnit); PathGenerator path(pathUnit);
// Same reason as getPathStepFrom: temp-Creature source doesn't trip // Same reason as getPathStepFrom: temp-Creature source doesn't trip
// CreateFilter's bot block, so apply the bot rules manually. // CreateFilter's bot block, so apply the bot cost biases manually.
path.SetExcludeFlags(NAV_GROUND_STEEP); path.SetNavTerrainCost(NAV_GROUND_STEEP, 5.0f);
path.SetNavTerrainCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
// Limit the pathfinding attempts // Limit the pathfinding attempts