Bug fixes for new house system and levels command

This commit is contained in:
JamDog 2010-12-07 15:44:21 +00:00
parent e068bfd5c0
commit b06cf00639
6 changed files with 82 additions and 63 deletions

View file

@ -35,8 +35,12 @@ export (QQ's a zone into a tarball)
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too)
@
[Dec 06 2010] - Jamdog
Fixed erroneous SYSERR report and incorrect contant in new house system (thanks Vatiken)
[Dec 06 2010] - Jamdog
Added new mail system, with inbox OLC, index rebuilder and first mail (to ID 1)
Bug-Fix: levels command wasn't showing max level, or validating high/low levels
score <mob> now shows stats for the mobile (same as 'stat <mob>')
[Dec 05 2010] - Jamdog
Bug-Fix: 'Did you mean' now only shows commands you have access to (thanks Welcor)
Bug-Fix: Fixed crash bug introduced by new house system when saving house contents

View file

@ -292,6 +292,7 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
void set_default_admin_privs(struct char_data *ch, bool keep_old);
int get_admin_level_by_string(char *lv);
void do_stat_character(struct char_data *ch, struct char_data *k);
/* Functions with subcommands */
/* do_date */
ACMD(do_date);

View file

@ -801,8 +801,11 @@ ACMD(do_score)
}
}
if (IS_NPC(vict))
if (IS_NPC(vict)) {
send_to_char(ch, "Stats for: %s\r\n", GET_NAME(vict));
do_stat_character(ch, vict);
return;
}
if (ch != vict)
send_to_char(ch, "Score for: %s %s (level %d)\r\n", GET_NAME(vict), GET_TITLE(vict), GET_LEVEL(vict));
@ -1723,7 +1726,7 @@ ACMD(do_levels)
{
char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH];
size_t len = 0, nlen;
int i, ret, min_lev=1, max_lev=CONFIG_MAX_LEVEL, val;
int i, ret, min_lev=1, max_lev=CONFIG_MAX_LEVEL, val, tmp;
if (IS_NPC(ch)) {
send_to_char(ch, "You ain't nothin' but a hound-dog.\r\n");
@ -1757,14 +1760,25 @@ ACMD(do_levels)
send_to_char(ch, "Displays exp required for levels.\r\n");
send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, CONFIG_MAX_LEVEL);
send_to_char(ch, "%slevels 5 %s- shows 5 levels either side of your current level\r\n", QCYN, QNRM);
send_to_char(ch, "%slevels 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM);
send_to_char(ch, "%slevels 10-20 %s- shows level 10 to level 20\r\n",QCYN, QNRM);
return;
}
}
/* If max and min are wrong way round, swap them */
if (max_lev > min_lev) {
tmp = min_lev;
min_lev = max_lev;
max_lev = tmp;
}
for (i = min_lev; i < max_lev; i++) {
nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d-%-8d : ", (int)i,
level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i + 1) - 1);
for (i = min_lev; i <= max_lev; i++) {
if (i < CONFIG_MAX_LEVEL) {
nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d-%-8d : ", (int)i,
level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i + 1) - 1);
} else {
nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d : ", (int)i,
level_exp(GET_CLASS(ch), i));
}
if (len + nlen >= sizeof(buf))
break;
len += nlen;

View file

@ -40,7 +40,6 @@ static void perform_immort_invis(struct char_data *ch, int level);
static void list_zone_commands_room(struct char_data *ch, room_vnum rvnum);
static void do_stat_room(struct char_data *ch, struct room_data *rm);
static void do_stat_object(struct char_data *ch, struct obj_data *j);
static void do_stat_character(struct char_data *ch, struct char_data *k);
static void stop_snooping(struct char_data *ch);
static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int listall);
static struct char_data *is_in_game(long idnum);
@ -747,7 +746,7 @@ static void do_stat_object(struct char_data *ch, struct obj_data *j)
do_sstat_object(ch, j);
}
static void do_stat_character(struct char_data *ch, struct char_data *k)
void do_stat_character(struct char_data *ch, struct char_data *k)
{
char buf[MAX_STRING_LENGTH];
int i, i2, column, found = FALSE;

View file

@ -590,7 +590,7 @@ const char *house_bits[] = {
const char *house_types[] = {
"PLAYER_OWNED",
"IMM_OWNED",
"CLAN_OWNED",
"PLAYER_SHOP",
"\n"
};

View file

@ -647,61 +647,62 @@ void House_boot(void)
/* We didn't reach the end of the file, so start a new house */
clear_house_control_data(&temp_house);
temp_house.vnum = atoi(line+1);
} else {
tag_argument(line, tag);
switch (*tag) {
case 'A':
if (!strcmp(tag, "Atrm")) temp_house.atrium = atoi(line);
else if (!strcmp(tag, "ADir")) temp_house.exit_num = atoi(line);
else bad_tag = TRUE;
break;
case 'B':
if (!strcmp(tag, "Bldr")) temp_house.built_by = atol(line);
else if (!strcmp(tag, "BldT")) temp_house.built_on = atol(line);
else bad_tag = TRUE;
break;
case 'F':
if (!strcmp(tag, "Flgs")) parse_house_flags(&temp_house, line);
else bad_tag = TRUE;
break;
case 'G':
if (!strcmp(tag, "Gsts")) parse_house_guests(&temp_house, fl);
else bad_tag = TRUE;
break;
case 'M':
if (!strcmp(tag, "Mode")) temp_house.mode = atoi(line);
else bad_tag = TRUE;
break;
case 'O':
if (!strcmp(tag, "Ownr")) temp_house.owner = atol(line);
else bad_tag = TRUE;
break;
case 'P':
if (!strcmp(tag, "Paym")) temp_house.last_payment = atol(line);
else bad_tag = TRUE;
break;
case 'R':
if (!strcmp(tag, "Recp")) temp_house.receptionist = (mob_vnum)(atoi(line));
else bad_tag = TRUE;
break;
default:
bad_tag = TRUE;
break;
}
if (bad_tag) {
bad_tag = FALSE;
log("SYSERR: Unknown tag %s in house control file %s", tag, HCONTROL_FILE);
}
}
tag_argument(line, tag);
switch (*tag) {
case 'A':
if (!strcmp(tag, "Atrm")) temp_house.atrium = atoi(line);
else if (!strcmp(tag, "ADir")) temp_house.exit_num = atoi(line);
else bad_tag = TRUE;
break;
case 'B':
if (!strcmp(tag, "Bldr")) temp_house.built_by = atol(line);
else if (!strcmp(tag, "BldT")) temp_house.built_on = atol(line);
else bad_tag = TRUE;
break;
case 'F':
if (!strcmp(tag, "Flgs")) parse_house_flags(&temp_house, line);
else bad_tag = TRUE;
break;
case 'G':
if (!strcmp(tag, "Gsts")) parse_house_guests(&temp_house, fl);
else bad_tag = TRUE;
break;
case 'M':
if (!strcmp(tag, "Mode")) temp_house.mode = atoi(line);
else bad_tag = TRUE;
break;
case 'O':
if (!strcmp(tag, "Ownr")) temp_house.owner = atol(line);
else bad_tag = TRUE;
break;
case 'P':
if (!strcmp(tag, "Paym")) temp_house.last_payment = atol(line);
else bad_tag = TRUE;
break;
case 'R':
if (!strcmp(tag, "Recp")) temp_house.receptionist = (mob_vnum)(atoi(line));
else bad_tag = TRUE;
break;
default:
bad_tag = TRUE;
break;
}
if (bad_tag) {
bad_tag = FALSE;
log("SYSERR: Unknown tag %s in house control file %s", tag, HCONTROL_FILE);
}
}
/* End of file incorrectly reached, warn, tidy up, and get out */