Skip to content

Commit 7cb4788

Browse files
fix #13
1 parent 54cc451 commit 7cb4788

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Creatures.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,15 @@ void DrawCreatureText(int drawx, int drawy, SS_Unit* creature )
410410
textcol = al_map_rgb(255,255,255);
411411
}
412412

413-
if (!creature->origin->name.nickname.empty() && ssConfig.names_use_nick) {
413+
auto name = Units::getVisibleName(creature->origin);
414+
if (!name->nickname.empty() && ssConfig.names_use_nick) {
414415
draw_textf_border(font, textcol, drawx, drawy-((WALLHEIGHT*ssConfig.scale)+al_get_font_line_height(font) + offsety), 0,
415-
"%s", DF2UTF(creature->origin->name.nickname).c_str());
416+
"%s", DF2UTF(name->nickname).c_str());
416417
}
417-
else if (!creature->origin->name.first_name.empty())
418+
else if (!name->first_name.empty())
418419
{
419420
char buffer[128];
420-
strncpy(buffer,creature->origin->name.first_name.c_str(),127);
421+
strncpy(buffer,name->first_name.c_str(), 127);
421422
buffer[127]=0;
422423
ALLEGRO_USTR* temp = bufferToUstr(buffer, 128);
423424
al_ustr_set_chr(temp, 0, charToUpper(al_ustr_get(temp, 0)));

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Template for new versions:
4343
- `stonesense`: added ``CLOSEONESC`` config, off by default.
4444
## Fixes
4545
- `stonesense`: stonesense no longer crashes when resizing the window due to switching to using OpenGL for rendering.
46+
- `stonesense`: vampires no longer show their true name when they shouldn't.
4647
## Misc Improvements
4748
- `stonesense`: changed announcements to be right-aligned and limited it to only show the most recent 10 announcements.
4849
- `stonesense`: ``init.txt`` config file is now read from ``dfhack-configs/stonesense/init.txt``

0 commit comments

Comments
 (0)