From 006564faf3fbe85682448aaf5d899ff9fbbde22c Mon Sep 17 00:00:00 2001
From: Aaron Veden <veden@vedbyte.com>
Date: Wed, 5 Apr 2023 22:47:48 -0700
Subject: [PATCH] FACTO-291: Increased move command radius and switched form
 group distraction

---
 changelog.txt    | 2 ++
 libs/Upgrade.lua | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/changelog.txt b/changelog.txt
index e1494a3..706b71f 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -5,6 +5,8 @@ Version: 3.3.0
     - Squad should not compress when close to player structures
   Tweaks:
     - On group destruction all members are destroyed to prevent orphaned biters
+    - Increased radius of what pathing requires to complete a move path request
+    - Switched use_group_distraction to true on forming group
   Bugfixes:
     - Fixed occasionally compression number wouldn't appear on unit group
     - Fixed squad compression could take place when attacking
diff --git a/libs/Upgrade.lua b/libs/Upgrade.lua
index 0653697..cd47c07 100644
--- a/libs/Upgrade.lua
+++ b/libs/Upgrade.lua
@@ -316,8 +316,9 @@ local function addCommandSet()
     Universe.squadQueries.moveCommand = {
         type = DEFINES_COMMAND_GO_TO_LOCATION,
         destination = {0,0},
-        pathfind_flags = { cache = true },
-        distraction = DEFINES_DISTRACTION_BY_ENEMY
+        pathfind_flags = { cache = true, prefer_straight_paths = true },
+        distraction = DEFINES_DISTRACTION_BY_ENEMY,
+        radius = 5
     }
     Universe.squadQueries.settleCommand = {
         type = DEFINES_COMMAND_BUILD_BASE,
@@ -372,7 +373,7 @@ local function addCommandSet()
         type = DEFINES_COMMAND_GROUP,
         group = nil,
         distraction = DEFINES_DISTRACTION_BY_ANYTHING,
-        use_group_distraction = false
+        use_group_distraction = true
     }
     Universe.squadQueries.formCommand = {
         command = Universe.squadQueries.formGroupCommand,