From d8377d48785f5b3a4b62caeb9aebcdf90444328a Mon Sep 17 00:00:00 2001 From: Snowstar38 Date: Tue, 8 Jul 2025 21:28:04 -0400 Subject: [PATCH] fix for rename Names are stored in 3 locations (the main unit, historical figure, and soul), not 2 I think this is fine but if anything messes with current_soul then never mind - I have never had current_soul be changed to a seprate individual with a different name from the unit itself but I am new to the game --- gui/rename.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gui/rename.lua b/gui/rename.lua index 397d651c4..b6a5d472b 100644 --- a/gui/rename.lua +++ b/gui/rename.lua @@ -93,14 +93,17 @@ local function get_hf_target(hf) local unit = df.unit.find(hf.unit_id) local sync_names = {} if unit then - local unit_name = dfhack.units.getVisibleName(unit) - if unit_name ~= name then - table.insert(sync_names, unit_name) + -- Always sync unit.name + table.insert(sync_names, unit.name) + -- Also sync current_soul.name if present + if unit.status.current_soul then + table.insert(sync_names, unit.status.current_soul.name) end end return {name=name, sync_names=sync_names, civ_id=hf.civ_id} end + local function get_unit_target(unit) if not unit then return end local hf = df.historical_figure.find(unit.hist_figure_id)