From e1b69ddf8467427d70253ff94f45206b1b914974 Mon Sep 17 00:00:00 2001 From: Venseer Date: Tue, 29 Oct 2024 19:21:48 -0300 Subject: [PATCH] Improved atCommand(mobinfo) --- src/map/atcommand.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e3fc633d86f..56a6a4613f5 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7253,12 +7253,16 @@ ACMD(mobinfo) } #endif - if (item_data->slot) - snprintf(atcmd_output2, sizeof(atcmd_output2), " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)droprate / 100); - else - snprintf(atcmd_output2, sizeof(atcmd_output2), " - %s %02.02f%%", item_data->jname, (float)droprate / 100); - - strcat(atcmd_output, atcmd_output2); + struct item link_item = { 0 }; + link_item.nameid = monster->dropitem[i].nameid; + StringBuf buf; + StrBuf->Init(&buf); + StrBuf->AppendStr(&buf, " - "); + clif->format_itemlink(&buf, &link_item); + snprintf(atcmd_output2, sizeof(atcmd_output2), " %02.02f%%", (float)droprate / 100); + StrBuf->AppendStr(&buf, atcmd_output2); + strcat(atcmd_output, StrBuf->Value(&buf)); + StrBuf->Destroy(&buf); if (++j % 3 == 0) { clif->message(fd, atcmd_output);