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 4faa4be
Showing 1 changed file with 5 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

0 comments on commit 4faa4be

Please sign in to comment.