Skip to content

Commit

Permalink
Improved atCommand(mobinfo)
Browse files Browse the repository at this point in the history
  • Loading branch information
Venseer committed Oct 29, 2024
1 parent 84da0df commit e1b69dd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e1b69dd

Please sign in to comment.