From 4055d3be8164fc78d4622ed0522335840289ac4b Mon Sep 17 00:00:00 2001 From: magnus Date: Sun, 30 Aug 2026 13:19:04 -0500 Subject: [PATCH] bodyswap: pass the just_born argument to create_nemesis unit:create_nemesis takes (important, inplay, just_born); the two-argument call fails with "cannot invoke unit.create_nemesis(): invalid argument count", so bodyswapping into a unit that has no nemesis record errors out. --- bodyswap.lua | 2 +- changelog.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bodyswap.lua b/bodyswap.lua index e64f43f783..2d783c6db6 100644 --- a/bodyswap.lua +++ b/bodyswap.lua @@ -34,7 +34,7 @@ function clearNemesisFromLinkedSites(nem) end function createNemesis(unit) - local nemesis = unit:create_nemesis(1, 1) + local nemesis = unit:create_nemesis(1, 1, false) nemesis.figure.flags.never_cull = true return nemesis end diff --git a/changelog.txt b/changelog.txt index cf07906e0c..ef05a64c36 100644 --- a/changelog.txt +++ b/changelog.txt @@ -31,6 +31,7 @@ Template for new versions: ## New Features ## Fixes +- `bodyswap`: fix "invalid argument count" when the target unit has no nemesis record - `fix/loyaltycascade`: guard against citizens that are not historical figures and emit a warning. - `gui/siegemanager`: fix nil index if there are no siege engines on the map