From 039fe84e6316c9d0ed55f4e1e23642bbf33464a6 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 30 Jul 2024 22:53:01 -0700 Subject: [PATCH] set histfig name as well as unit name --- changelog.txt | 1 + makeown.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/changelog.txt b/changelog.txt index 720297b06c..9fbb1263cb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -38,6 +38,7 @@ Template for new versions: - `prioritize`: fix incorrect loading of persisted data on some OS types - `list-waves`: no longer gets confused by units that leave the map and then return (e.g. squads who go out on raids) - `fix/dead-units`: fix error when removing dead units from burrows and the unit with the greatest ID was dead +- `makeown`: ensure names given to adopted units (or units created with `gui/sandbox`) are respected later in legends mode ## Misc Improvements - `build-now`: if `suspendmanager` is running, run an unsuspend cycle immediately before scanning for buildings to build diff --git a/makeown.lua b/makeown.lua index cbfe3433aa..565b7c6856 100644 --- a/makeown.lua +++ b/makeown.lua @@ -32,6 +32,10 @@ function name_unit(unit) unit.name.parts_of_speech.RearCompound = df.part_of_speech.Verb3rdPerson unit.name.type = df.language_name_type.Figure unit.name.has_name = true + + local hf = df.historical_figure.find(unit.hist_figure_id) + if not hf then return end + hf.name:assign(unit.name) end local function fix_clothing_ownership(unit)