diff --git a/docs/changelog.txt b/docs/changelog.txt index 083697b3b..eec027a1f 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -38,6 +38,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: # Future ## Fixes +- Fixed displayed names (from ``Units::getVisibleName``) for units with identities - `fix/dead-units`: fixed script trying to use missing isDiplomat function ## Misc Improvements diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index fc2f20c6a..bc8d1ae88 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -219,15 +219,9 @@ df::language_name *Units::getVisibleName(df::unit *unit) { CHECK_NULL_POINTER(unit); + // as of 0.44.11, identity names take precedence over associated histfig names if (auto identity = getIdentity(unit)) - { - auto id_hfig = df::historical_figure::find(identity->histfig_id); - - if (id_hfig) - return &id_hfig->name; - return &identity->name; - } return &unit->name; }