Skip to content

Commit

Permalink
fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
realSquidCoder committed Jan 10, 2025
1 parent 54cc451 commit 7cb4788
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Creatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down

0 comments on commit 7cb4788

Please sign in to comment.