Skip to content

Fix for rename #1478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions gui/rename.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down