From 5479f89a212502be7aadc6ecfbe71bab21bb1d9c Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Fri, 26 Jun 2026 08:44:55 -0700 Subject: [PATCH 1/4] Annotate SetNavigatorPersonalPosMaxDistance --- engine/Sim.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/engine/Sim.lua b/engine/Sim.lua index 25e442043a9..854d4cf2593 100644 --- a/engine/Sim.lua +++ b/engine/Sim.lua @@ -1194,6 +1194,19 @@ end function SetIgnorePlayableRect(army, ignore) end +--- Changes the distance at which the default navigator switches to a lower resolution +--- pathfinding grid, typically resulting in units moving in columns over large distances +--- instead of maintaining their formation. +--- +--- Default engine value is 50. +--- +--- Useful console commands for debugging: "dbg navwaypoints", "dbg navpath", "dbg navsteering" +--- +--- Introduced by https://github.com/FAForever/FA-Binary-Patches/pull/132 +---@param distance number +function SetNavigatorPersonalPosMaxDistance(distance) +end + --- sets the playable area of a map ---@param minX number ---@param minZ number From cb2afa7c646fb252efebb021f5de5deaaafe3558 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Fri, 26 Jun 2026 08:45:10 -0700 Subject: [PATCH 2/4] Verify the function exists before calling it --- lua/simInit.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/simInit.lua b/lua/simInit.lua index 48e3c8bcde8..2505cc229ac 100644 --- a/lua/simInit.lua +++ b/lua/simInit.lua @@ -586,7 +586,9 @@ end -- will be using personal positioning instead of waypoints for any move order (doesn't affect "formation move"). -- useful console commands for debugging: "dbg navwaypoints", "dbg navpath", "dbg navsteering" function SetupPathfinding() - SetNavigatorPersonalPosMaxDistance(9999) + if rawget(_G, "SetNavigatorPersonalPosMaxDistance") then + SetNavigatorPersonalPosMaxDistance(9999) + end end -- these imports break cycle dependencies of import sequences of mods From 218bd78a5cbe70915a1532daddeb832781b52a9c Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Fri, 26 Jun 2026 08:53:02 -0700 Subject: [PATCH 3/4] Create other.7155.md --- changelog/snippets/other.7155.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/snippets/other.7155.md diff --git a/changelog/snippets/other.7155.md b/changelog/snippets/other.7155.md new file mode 100644 index 00000000000..ffbec8cc2c0 --- /dev/null +++ b/changelog/snippets/other.7155.md @@ -0,0 +1 @@ +- (#7155) Annotate `SetNavigatorPersonalPosMaxDistance` and check it exists before calling it. From f44d8402d610b47dd707d4503dbf3abc6afc4135 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Tue, 30 Jun 2026 00:51:45 -0700 Subject: [PATCH 4/4] Explain the "personal" part of the function name --- engine/Sim.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/Sim.lua b/engine/Sim.lua index 854d4cf2593..8aeffccdefb 100644 --- a/engine/Sim.lua +++ b/engine/Sim.lua @@ -1195,8 +1195,8 @@ function SetIgnorePlayableRect(army, ignore) end --- Changes the distance at which the default navigator switches to a lower resolution ---- pathfinding grid, typically resulting in units moving in columns over large distances ---- instead of maintaining their formation. +--- pathfinding grid (from "personal" per-unit waypoints to waypoints shared by many units), +--- typically resulting in units moving in columns over large distances instead of maintaining their formation. --- --- Default engine value is 50. ---