mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-23 18:50:13 +01:00
Major: Backport to rvn 241, with the addition of all previously found bug fixes.
This commit is contained in:
parent
e4cdc51eb1
commit
479dbb6cbd
86 changed files with 3771 additions and 7913 deletions
43
src/hedit.c
43
src/hedit.c
|
|
@ -64,7 +64,7 @@ ACMD(do_oasis_hedit)
|
|||
d = ch->desc;
|
||||
|
||||
if (!str_cmp("save", argument)) {
|
||||
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves help files.",
|
||||
mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves help files.",
|
||||
GET_NAME(ch));
|
||||
hedit_save_to_disk(d);
|
||||
send_to_char(ch, "Saving help files.\r\n");
|
||||
|
|
@ -73,14 +73,14 @@ ACMD(do_oasis_hedit)
|
|||
|
||||
/* Give descriptor an OLC structure. */
|
||||
if (d->olc) {
|
||||
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure.");
|
||||
mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure.");
|
||||
free(d->olc);
|
||||
}
|
||||
|
||||
CREATE(d->olc, struct oasis_olc_data, 1);
|
||||
OLC_NUM(d) = 0;
|
||||
OLC_STORAGE(d) = strdup(arg);
|
||||
OLC_ZNUM(d) = search_help(OLC_STORAGE(d), ADMLVL_IMPL);
|
||||
OLC_ZNUM(d) = search_help(OLC_STORAGE(d), LVL_IMPL);
|
||||
|
||||
if (OLC_ZNUM(d) == NOWHERE) {
|
||||
send_to_char(ch, "Do you wish to add the '%s' help file? ", OLC_STORAGE(d));
|
||||
|
|
@ -93,7 +93,7 @@ ACMD(do_oasis_hedit)
|
|||
STATE(d) = CON_HEDIT;
|
||||
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
|
||||
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
|
||||
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
|
||||
mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
|
||||
}
|
||||
|
||||
static void hedit_setup_new(struct descriptor_data *d)
|
||||
|
|
@ -170,7 +170,7 @@ static void hedit_save_to_disk(struct descriptor_data *d)
|
|||
remove_from_save_list(HEDIT_PERMISSION, SL_HLP);
|
||||
|
||||
/* Reboot the help files. */
|
||||
free_help_table();
|
||||
free_help_table();
|
||||
index_boot(DB_BOOT_HLP);
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
case 'Y':
|
||||
snprintf(buf, sizeof(buf), "OLC: %s edits help for %s.", GET_NAME(d->character),
|
||||
OLC_HELP(d)->keywords);
|
||||
mudlog(TRUE, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), CMP, "%s", buf);
|
||||
mudlog(TRUE, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), CMP, "%s", buf);
|
||||
write_to_output(d, "Help saved to disk.\r\n");
|
||||
hedit_save_internally(d);
|
||||
|
||||
|
|
@ -229,9 +229,9 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
case 'y': case 'Y':
|
||||
hedit_setup_existing(d, OLC_ZNUM(d));
|
||||
break;
|
||||
case 'q': case 'Q':
|
||||
case 'q': case 'Q':
|
||||
cleanup_olc(d, CLEANUP_ALL);
|
||||
break;
|
||||
break;
|
||||
case 'n': case 'N':
|
||||
OLC_ZNUM(d)++;
|
||||
for (; OLC_ZNUM(d) < top_of_helpt; OLC_ZNUM(d)++)
|
||||
|
|
@ -248,7 +248,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
write_to_output(d, "Do you wish to edit the '%s' help file? ",
|
||||
help_table[OLC_ZNUM(d)].keywords);
|
||||
OLC_MODE(d) = HEDIT_CONFIRM_EDIT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
write_to_output(d, "Invalid choice!\r\n"
|
||||
|
|
@ -300,7 +300,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
OLC_VAL(d) = 1;
|
||||
break;
|
||||
case '2':
|
||||
write_to_output(d, "Enter min admin level : ");
|
||||
write_to_output(d, "Enter min level : ");
|
||||
OLC_MODE(d) = HEDIT_MIN_LEVEL;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -321,13 +321,13 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
|
||||
case HEDIT_ENTRY:
|
||||
/* We will NEVER get here, we hope. */
|
||||
mudlog(TRUE, ADMLVL_BUILDER, BRF, "SYSERR: Reached HEDIT_ENTRY case in parse_hedit");
|
||||
mudlog(TRUE, LVL_BUILDER, BRF, "SYSERR: Reached HEDIT_ENTRY case in parse_hedit");
|
||||
break;
|
||||
|
||||
case HEDIT_MIN_LEVEL:
|
||||
number = atoi(arg);
|
||||
if ((number < ADMLVL_MORTAL) || (number > ADMLVL_IMPL))
|
||||
write_to_output(d, "That is not a valid choice!\r\nEnter min admin level:-\r\n] ");
|
||||
if ((number < 0) || (number > LVL_IMPL))
|
||||
write_to_output(d, "That is not a valid choice!\r\nEnter min level:-\r\n] ");
|
||||
else {
|
||||
OLC_HELP(d)->min_level = number;
|
||||
break;
|
||||
|
|
@ -336,7 +336,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
|
|||
|
||||
default:
|
||||
/* We should never get here. */
|
||||
mudlog(TRUE, ADMLVL_BUILDER, BRF, "SYSERR: Reached default case in parse_hedit");
|
||||
mudlog(TRUE, LVL_BUILDER, BRF, "SYSERR: Reached default case in parse_hedit");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -361,10 +361,9 @@ ACMD(do_helpcheck)
|
|||
int i, count = 0;
|
||||
size_t len = 0, nlen;
|
||||
|
||||
|
||||
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 (search_help(complete_cmd_info[i].command, ADMLVL_IMPL) == NOWHERE) {
|
||||
if (search_help(complete_cmd_info[i].command, LVL_IMPL) == NOWHERE) {
|
||||
nlen = snprintf(buf + len, sizeof(buf) - len, "%-20.20s%s", complete_cmd_info[i].command,
|
||||
(++count % 3 ? "" : "\r\n"));
|
||||
if (len + nlen >= sizeof(buf))
|
||||
|
|
@ -377,12 +376,12 @@ ACMD(do_helpcheck)
|
|||
nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n");
|
||||
|
||||
if (ch->desc) {
|
||||
if (len == 0)
|
||||
send_to_char(ch, "All commands have help entries.\r\n");
|
||||
else {
|
||||
send_to_char(ch, "Commands without help entries:\r\n");
|
||||
page_string(ch->desc, buf, TRUE);
|
||||
}
|
||||
if (len == 0)
|
||||
send_to_char(ch, "All commands have help entries.\r\n");
|
||||
else {
|
||||
send_to_char(ch, "Commands without help entries:\r\n");
|
||||
page_string(ch->desc, buf, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue