From a95ac76ef7e150145e3737abfd9ffb836bf18f34 Mon Sep 17 00:00:00 2001 From: JamDog Date: Thu, 25 Nov 2010 20:34:26 +0000 Subject: [PATCH] Added admin levels to who list, and minor bug fixes --- changelog | 1 + src/act.informative.c | 10 +++++++--- src/act.wizard.c | 4 ++-- src/interpreter.c | 5 +++++ src/redit.c | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/changelog b/changelog index 69b3104..070d925 100644 --- a/changelog +++ b/changelog @@ -40,6 +40,7 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) Bug-Fix: admin default now targets the victim player Bug-Fix: Crash bug developed due to no 'vict' in is_tell_ok, added checks Added HIDDEN flag for doors, hiding from exits, autoexits, scan and map + Admins now show admin level instead of class on who list [Nov 24 2010] - Jamdog Split mortal and admin levels (thanks fnord for original patch/idea) Mortal level converted to ubyte for 255 max diff --git a/src/act.informative.c b/src/act.informative.c index bc735de..7dbe1cc 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -1146,7 +1146,7 @@ ACMD(do_who) struct descriptor_data *d; struct char_data *tch; int i, num_can_see = 0; - char name_search[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH]; + char name_search[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], admlev[15]; char mode; int low = 0, high = CONFIG_MAX_LEVEL, localwho = 0, questwho = 0; int showclass = 0, short_list = 0, outlaws = 0; @@ -1301,16 +1301,20 @@ ACMD(do_who) if (showleader && (!tch->followers || !AFF_FLAGGED(tch, AFF_GROUP))) continue; + sprintf(admlev, "%11s", admin_level_names[(GET_ADMLEVEL(tch))]); if (short_list) { send_to_char(ch, "%s[%2d %s] %-12.12s%s%s", (IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""), - GET_LEVEL(tch), CLASS_ABBR(tch), GET_NAME(tch), + GET_LEVEL(tch), + (IS_ADMIN(tch, ADMLVL_IMMORT) ? admlev : CLASS_ABBR(tch)), + GET_NAME(tch), CCNRM(ch, C_SPR), ((!(++num_can_see % 4)) ? "\r\n" : "")); } else { num_can_see++; send_to_char(ch, "%s[%2d %s] %s%s%s%s", (IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""), - GET_LEVEL(tch), CLASS_ABBR(tch), + GET_LEVEL(tch), + (IS_ADMIN(tch, ADMLVL_IMMORT) ? admlev : CLASS_ABBR(tch)), GET_NAME(tch), (*GET_TITLE(tch) ? " " : ""), GET_TITLE(tch), CCNRM(ch, C_SPR)); diff --git a/src/act.wizard.c b/src/act.wizard.c index b6e3a69..4369d83 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -1655,9 +1655,9 @@ ACMD(do_admin) changed = FALSE; if (IS_NPC(vict)) { - send_to_char(ch, "%s is a mob, and mobs can't have admin privs!", GET_NAME(vict)); + send_to_char(ch, "%s is a mob, and mobs can't have admin privs!\r\n", GET_NAME(vict)); } else if (GET_ADMLEVEL(vict) > GET_ADMLEVEL(ch)) { - send_to_char(ch, "%s is a higher admin level, you can't change their admin privs!", GET_NAME(vict)); + send_to_char(ch, "%s is a higher admin level, you can't change their admin privs!\r\n", GET_NAME(vict)); } else if (!*arg2) { // Display player's current admin settings send_to_char(ch, "%sAdmin information for %s%s\r\n", QBWHT, GET_NAME(vict), QNRM); diff --git a/src/interpreter.c b/src/interpreter.c index af950b9..201b07b 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -1725,6 +1725,11 @@ ACMD(do_cmdinfo) one_argument(argument, arg); + if (!*arg) { + send_to_char(ch, "Usage: %scmdinfo %s", QYEL, QNRM); + return; + } + for (length = strlen(arg), c = 0; *complete_cmd_info[c].command != '\n'; c++) { if(!strncmp(complete_cmd_info[c].command, arg, length)) break; diff --git a/src/redit.c b/src/redit.c index 93a1752..6a06385 100644 --- a/src/redit.c +++ b/src/redit.c @@ -797,7 +797,7 @@ void redit_parse(struct descriptor_data *d, char *arg) case REDIT_EXIT_DOORFLAGS: number = atoi(arg); - if (number < 0 || number > 2) { + if (number < 0 || number > 4) { write_to_output(d, "That's not a valid choice!\r\n"); redit_disp_exit_flag_menu(d); } else {