diff --git a/src/boards.c b/src/boards.c index 9fb5674..72174f2 100644 --- a/src/boards.c +++ b/src/boards.c @@ -458,7 +458,8 @@ void board_load_board(int board_type) perror("SYSERR: Error reading board"); return; } - j = fread(&(num_of_msgs[board_type]), sizeof(int), 1, fl); + if (fread(&(num_of_msgs[board_type]), sizeof(int), 1, fl) != 1) + return; if (num_of_msgs[board_type] < 1 || num_of_msgs[board_type] > MAX_BOARD_MESSAGES) { log("SYSERR: Board file %d corrupt. Resetting.", board_type); board_reset_board(board_type); diff --git a/src/class.c b/src/class.c index fa0fffa..e9c29b6 100644 --- a/src/class.c +++ b/src/class.c @@ -1456,8 +1456,6 @@ void do_start(struct char_data *ch) GET_COND(ch, HUNGER) = 24; GET_COND(ch, DRUNK) = 0; - SET_BIT_AR(PRF_FLAGS(ch), PRF_AUTOEXIT); - if (CONFIG_SITEOK_ALL) SET_BIT_AR(PLR_FLAGS(ch), PLR_SITEOK); } diff --git a/src/db.c b/src/db.c index 1e45d92..6ccff4b 100644 --- a/src/db.c +++ b/src/db.c @@ -643,7 +643,7 @@ void boot_db(void) log("Initialize Global Lists"); global_lists = create_list(); - + log("Initializing Events"); init_events(); @@ -2376,6 +2376,7 @@ struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */ mob_index[i].number++; GET_ID(mob) = max_mob_id++; + /* find_char helper */ add_to_lookup_table(GET_ID(mob), (void *)mob); @@ -3473,6 +3474,18 @@ void init_char(struct char_data *ch) GET_LOADROOM(ch) = NOWHERE; GET_SCREEN_WIDTH(ch) = PAGE_WIDTH; + + /* Set Beginning Toggles Here */ + SET_BIT_AR(PRF_FLAGS(ch), PRF_AUTOEXIT); + if (ch->desc) + if (ch->desc->pProtocol->pVariables[eMSDP_ANSI_COLORS] || + ch->desc->pProtocol->pVariables[eMSDP_XTERM_256_COLORS]) { + SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1); + SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2); + } + SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPHP); + SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMANA); + SET_BIT_AR(PRF_FLAGS(ch), PRF_DISPMOVE); } /* returns the real number of the room with given virtual number */ diff --git a/src/house.c b/src/house.c index 71a54fd..a0585e3 100644 --- a/src/house.c +++ b/src/house.c @@ -213,14 +213,16 @@ static int find_house(room_vnum vnum) static void House_save_control(void) { FILE *fl; - int i; if (!(fl = fopen(HCONTROL_FILE, "wb"))) { perror("SYSERR: Unable to open house control file."); return; } /* write all the house control recs in one fell swoop. Pretty nifty, eh? */ - i = fwrite(house_control, sizeof(struct house_control_rec), num_of_houses, fl); + if (fwrite(house_control, sizeof(struct house_control_rec), num_of_houses, fl) != num_of_houses) { + perror("SYSERR: Unable to save house control file."); + return; + } fclose(fl); } @@ -232,7 +234,6 @@ void House_boot(void) struct house_control_rec temp_house; room_rnum real_house, real_atrium; FILE *fl; - int i; memset((char *)house_control,0,sizeof(struct house_control_rec)*MAX_HOUSES); @@ -244,7 +245,8 @@ void House_boot(void) return; } while (!feof(fl) && num_of_houses < MAX_HOUSES) { - i = fread(&temp_house, sizeof(struct house_control_rec), 1, fl); + if (fread(&temp_house, sizeof(struct house_control_rec), 1, fl) != 1) + break; if (feof(fl)) break; @@ -663,7 +665,7 @@ static int ascii_convert_house(struct char_data *ch, obj_vnum vnum) FILE *in, *out; char infile[MAX_INPUT_LENGTH], *outfile; struct obj_data *tmp; - int i, j=0, k; + int i, j=0; House_get_filename(vnum, infile, sizeof(infile)); @@ -687,7 +689,8 @@ static int ascii_convert_house(struct char_data *ch, obj_vnum vnum) while (!feof(in)) { struct obj_file_elem object; - k = fread(&object, sizeof(struct obj_file_elem), 1, in); + if (fread(&object, sizeof(struct obj_file_elem), 1, in) != 1) + return (0); if (ferror(in)) { perror("SYSERR: Reading house file in House_load"); send_to_char(ch, "...read error in house rent file.\r\n"); diff --git a/src/protocol.h b/src/protocol.h index ed52505..4249bde 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -37,7 +37,7 @@ typedef struct descriptor_data descriptor_t; #define MAX_PROTOCOL_BUFFER 2048 #define MAX_VARIABLE_LENGTH 4096 -#define MAX_OUTPUT_BUFFER 8192 +#define MAX_OUTPUT_BUFFER LARGE_BUFSIZE #define MAX_MSSP_BUFFER 4096 #define SEND 1