mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-24 03:00:13 +01:00
fixed helpcheck bug where, if all commands have help entries, garbage was displayed
This commit is contained in:
parent
6f88f62e76
commit
7fab30f86b
1 changed files with 8 additions and 5 deletions
13
src/hedit.c
13
src/hedit.c
|
|
@ -361,7 +361,6 @@ ACMD(do_helpcheck)
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
size_t len = 0, nlen;
|
size_t len = 0, nlen;
|
||||||
|
|
||||||
send_to_char(ch, "Commands without help entries:\r\n");
|
|
||||||
|
|
||||||
for (i = 1; *(complete_cmd_info[i].command) != '\n'; i++) {
|
for (i = 1; *(complete_cmd_info[i].command) != '\n'; i++) {
|
||||||
if (complete_cmd_info[i].command_pointer != do_action && complete_cmd_info[i].minimum_level >= 0) {
|
if (complete_cmd_info[i].command_pointer != do_action && complete_cmd_info[i].minimum_level >= 0) {
|
||||||
|
|
@ -377,10 +376,14 @@ ACMD(do_helpcheck)
|
||||||
if (count % 3 && len < sizeof(buf))
|
if (count % 3 && len < sizeof(buf))
|
||||||
nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n");
|
nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n");
|
||||||
|
|
||||||
if (ch->desc)
|
if (ch->desc) {
|
||||||
page_string(ch->desc, buf, TRUE);
|
if (len == 0)
|
||||||
|
send_to_char(ch, "All commands have help entries.\r\n");
|
||||||
*buf = '\0';
|
else {
|
||||||
|
send_to_char(ch, "Commands without help entries:\r\n");
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ACMD(do_hindex)
|
ACMD(do_hindex)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue