From 7cb4788fac39aeb9de10e690b0c9db1c738d3c09 Mon Sep 17 00:00:00 2001 From: Squid Coder <92821989+realSquidCoder@users.noreply.github.com> Date: Thu, 9 Jan 2025 20:44:59 -0600 Subject: [PATCH] fix https://github.com/DFHack/stonesense/issues/13 --- Creatures.cpp | 9 +++++---- docs/changelog.txt | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Creatures.cpp b/Creatures.cpp index 9a09873e..a1d9c40f 100644 --- a/Creatures.cpp +++ b/Creatures.cpp @@ -410,14 +410,15 @@ void DrawCreatureText(int drawx, int drawy, SS_Unit* creature ) textcol = al_map_rgb(255,255,255); } - if (!creature->origin->name.nickname.empty() && ssConfig.names_use_nick) { + auto name = Units::getVisibleName(creature->origin); + if (!name->nickname.empty() && ssConfig.names_use_nick) { draw_textf_border(font, textcol, drawx, drawy-((WALLHEIGHT*ssConfig.scale)+al_get_font_line_height(font) + offsety), 0, - "%s", DF2UTF(creature->origin->name.nickname).c_str()); + "%s", DF2UTF(name->nickname).c_str()); } - else if (!creature->origin->name.first_name.empty()) + else if (!name->first_name.empty()) { char buffer[128]; - strncpy(buffer,creature->origin->name.first_name.c_str(),127); + strncpy(buffer,name->first_name.c_str(), 127); buffer[127]=0; ALLEGRO_USTR* temp = bufferToUstr(buffer, 128); al_ustr_set_chr(temp, 0, charToUpper(al_ustr_get(temp, 0))); diff --git a/docs/changelog.txt b/docs/changelog.txt index 9f6be0dd..60473108 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -43,6 +43,7 @@ Template for new versions: - `stonesense`: added ``CLOSEONESC`` config, off by default. ## Fixes - `stonesense`: stonesense no longer crashes when resizing the window due to switching to using OpenGL for rendering. +- `stonesense`: vampires no longer show their true name when they shouldn't. ## Misc Improvements - `stonesense`: changed announcements to be right-aligned and limited it to only show the most recent 10 announcements. - `stonesense`: ``init.txt`` config file is now read from ``dfhack-configs/stonesense/init.txt``