mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Travel): Soft-bias STEEP at regen PathGenerator sites
This commit is contained in:
parent
a460886c1c
commit
65bf6a0dff
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user