From 5ad2ab60da2c958b0e586e420b1f0994821b0169 Mon Sep 17 00:00:00 2001 From: relent0r Date: Fri, 28 Aug 2026 13:33:09 +1200 Subject: [PATCH 1/5] add guard against cases of platoon functions not being availble during platoon death --- lua/SimUtils.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/SimUtils.lua b/lua/SimUtils.lua index 8402216e73..5c0ec60bf4 100644 --- a/lua/SimUtils.lua +++ b/lua/SimUtils.lua @@ -1437,8 +1437,12 @@ function DisableAI(self) if not unit.Dead then local handle = unit.PlatoonHandle if handle and self:PlatoonExists(handle) then - handle:Stop() - handle:PlatoonDisbandNoAssign() + if handle.Stop then + handle:Stop() + end + if handle.PlatoonDisbandNoAssig then + handle:PlatoonDisbandNoAssign() + end end IssueStop({ unit }) IssueToUnitClearCommands(unit) From bb66e1cd30684d86ea503e5499523d7121e06400 Mon Sep 17 00:00:00 2001 From: relent0r Date: Fri, 28 Aug 2026 13:41:18 +1200 Subject: [PATCH 2/5] add snippet --- changelog/snippets/ai.7256.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/snippets/ai.7256.md diff --git a/changelog/snippets/ai.7256.md b/changelog/snippets/ai.7256.md new file mode 100644 index 0000000000..6e62c8c089 --- /dev/null +++ b/changelog/snippets/ai.7256.md @@ -0,0 +1 @@ +- Add guards for platoon function calls in the DisablAI function to stop errors during the OnDefeat call. \ No newline at end of file From b1ad7c05c4aef7ca3fdbe53454b72378ed578628 Mon Sep 17 00:00:00 2001 From: relent0r Date: Fri, 28 Aug 2026 13:42:57 +1200 Subject: [PATCH 3/5] fix snippet typo as I can't spell --- changelog/snippets/ai.7256.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/snippets/ai.7256.md b/changelog/snippets/ai.7256.md index 6e62c8c089..85cd5a147c 100644 --- a/changelog/snippets/ai.7256.md +++ b/changelog/snippets/ai.7256.md @@ -1 +1 @@ -- Add guards for platoon function calls in the DisablAI function to stop errors during the OnDefeat call. \ No newline at end of file +- Add guards for platoon function calls in the DisableAI function to stop errors during the OnDefeat call. \ No newline at end of file From 6e3601db3ff4600cf4b71adfc69770b5691e2d94 Mon Sep 17 00:00:00 2001 From: relent0r Date: Fri, 28 Aug 2026 16:03:29 +1200 Subject: [PATCH 4/5] typo that the bot caught (good bot) --- lua/SimUtils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/SimUtils.lua b/lua/SimUtils.lua index 5c0ec60bf4..06f2a29d1c 100644 --- a/lua/SimUtils.lua +++ b/lua/SimUtils.lua @@ -1440,7 +1440,7 @@ function DisableAI(self) if handle.Stop then handle:Stop() end - if handle.PlatoonDisbandNoAssig then + if handle.PlatoonDisbandNoAssign then handle:PlatoonDisbandNoAssign() end end From d689d10d49f602ead1998a41e723df51038fda77 Mon Sep 17 00:00:00 2001 From: Aaron Warner <34614077+relent0r@users.noreply.github.com> Date: Sat, 29 Aug 2026 07:31:46 +1200 Subject: [PATCH 5/5] Update changelog/snippets/ai.7256.md Co-authored-by: lL1l1 <82986251+lL1l1@users.noreply.github.com> --- changelog/snippets/ai.7256.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/snippets/ai.7256.md b/changelog/snippets/ai.7256.md index 85cd5a147c..04f77b83d8 100644 --- a/changelog/snippets/ai.7256.md +++ b/changelog/snippets/ai.7256.md @@ -1 +1 @@ -- Add guards for platoon function calls in the DisableAI function to stop errors during the OnDefeat call. \ No newline at end of file +- Fix error when an army is defeated related to missing AI platoon functions (#7256). \ No newline at end of file