refactor(Core/Movement): Rename SetAreaCost calls to SetNavTerrainCost

This commit is contained in:
bash 2026-05-29 15:39:43 +02:00
parent 2a8bd23272
commit a6d691e6a7
5 changed files with 7 additions and 7 deletions

View File

@ -4293,7 +4293,7 @@ bool ArenaTactics::Execute(Event /*event*/)
{ {
PathGenerator path(bot); PathGenerator path(bot);
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
path.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), false); path.CalculatePath(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), false);
if (path.GetPathType() != PATHFIND_NOPATH) if (path.GetPathType() != PATHFIND_NOPATH)

View File

@ -125,7 +125,7 @@ bool GoAction::Execute(Event event)
{ {
PathGenerator path(bot); PathGenerator path(bot);
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
path.CalculatePath(x, y, z, false); path.CalculatePath(x, y, z, false);

View File

@ -972,7 +972,7 @@ bool MovementAction::ReachCombatTo(Unit* target, float distance)
PathGenerator path(bot); PathGenerator path(bot);
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
path.CalculatePath(tx, ty, tz, false); path.CalculatePath(tx, ty, tz, false);
PathType type = path.GetPathType(); PathType type = path.GetPathType();
int typeOk = PATHFIND_NORMAL | PATHFIND_INCOMPLETE | PATHFIND_SHORTCUT; int typeOk = PATHFIND_NORMAL | PATHFIND_INCOMPLETE | PATHFIND_SHORTCUT;
@ -1881,7 +1881,7 @@ PathResult MovementAction::GeneratePath(float x, float y, float z, uint32 accept
PathResult result; PathResult result;
PathGenerator gen(bot); PathGenerator gen(bot);
gen.SetExcludeFlags(gen.GetExcludeFlags() | NAV_GROUND_STEEP); gen.SetExcludeFlags(gen.GetExcludeFlags() | NAV_GROUND_STEEP);
gen.SetAreaCost(NAV_WATER, 10.0f); gen.SetNavTerrainCost(NAV_WATER, 10.0f);
gen.CalculatePath(x, y, z, forceDestination); gen.CalculatePath(x, y, z, forceDestination);
result.pathType = gen.GetPathType(); result.pathType = gen.GetPathType();
result.reachable = !(result.pathType & (~acceptMask)); result.reachable = !(result.pathType & (~acceptMask));

View File

@ -727,7 +727,7 @@ std::vector<WorldPosition> WorldPosition::getPathStepFrom(WorldPosition startPos
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
// Bias against water polys so A* prefers shore routes. Matches the // Bias against water polys so A* prefers shore routes. Matches the
// runtime bot-Player filter setup in CreateFilter. // runtime bot-Player filter setup in CreateFilter.
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
auto result = getPathStepFrom(startPos, path); auto result = getPathStepFrom(startPos, path);
if (tempCreature) if (tempCreature)
@ -866,7 +866,7 @@ std::vector<WorldPosition> WorldPosition::getPathFromPath(std::vector<WorldPosit
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
// Bias against water polys so A* prefers shore routes (matches the // Bias against water polys so A* prefers shore routes (matches the
// runtime bot filter set up in CreateFilter for Player bots). // runtime bot filter set up in CreateFilter for Player bots).
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
// Limit the pathfinding attempts // Limit the pathfinding attempts
for (uint32 i = 0; i < maxAttempt; i++) for (uint32 i = 0; i < maxAttempt; i++)

View File

@ -1253,7 +1253,7 @@ TravelNodeRoute TravelNodeMap::FindRouteNearestNodes(WorldPosition startPos, Wor
{ {
PathGenerator path(bot); PathGenerator path(bot);
path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP); path.SetExcludeFlags(path.GetExcludeFlags() | NAV_GROUND_STEEP);
path.SetAreaCost(NAV_WATER, 10.0f); path.SetNavTerrainCost(NAV_WATER, 10.0f);
path.CalculatePath(startNodePosition.GetPositionX(), startNodePosition.GetPositionY(), startNodePosition.GetPositionZ()); path.CalculatePath(startNodePosition.GetPositionX(), startNodePosition.GetPositionY(), startNodePosition.GetPositionZ());
PathType type = path.GetPathType(); PathType type = path.GetPathType();
bool reachable = !(type & ~(PATHFIND_NORMAL | PATHFIND_INCOMPLETE | PATHFIND_FARFROMPOLY)); bool reachable = !(type & ~(PATHFIND_NORMAL | PATHFIND_INCOMPLETE | PATHFIND_FARFROMPOLY));