TomenetGame / tomenet

TomeNET is an online multiplayer roguelike role-playing game
https://www.tomenet.eu/
Other
70 stars 12 forks source link

Graphics: monster list shows wrong tiles #51

Closed EvgenijK closed 3 months ago

EvgenijK commented 1 year ago

When graphic is enabled monster lore list shows random(?) tiles instead of font or graphical ones.

Screenshot_20231009_233642

Displaying font symbol in monster lore was made in this PR https://github.com/TomenetGame/tomenet/pull/20 (it's mine one actually, but before graphics)

I think the problem is in usage of format() in monster_lore() like in this example(line 5386 from src/client/c-cmd.c)

if (Client_setup.r_char[monster_list_code[i]]) {
    Term_putstr(5, 5, -1, selected_line == 0 ? TERM_YELLOW : TERM_UMBER, format("(%4d, L%-3d, \377%c%c\377%c/\377%c%c\377%c)  %s",
        monster_list_code[i], monster_list_level[i], monster_list_symbol[i][0], monster_list_symbol[i][1], n == selected_line ? 'y' : 'u',
        monster_list_symbol[i][0], Client_setup.r_char[monster_list_code[i]], n == selected_line ? 'y' : 'u', monster_list_name[i]));
} else {

Format is %c for Client_setup.r_char[monster_list_code[i]], that is char32_t now.

I tried to change %c to %u but got just numbers instead of symbols. Screenshot_20231010_005737

EvgenijK commented 3 months ago

Solved by @CBlueGH in recent update