mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-21 02:51:45 +01:00
Couple more gcc warnings killed, fixed a bug within protocol.c, and added initial colour detections based on protocol findings.
This commit is contained in:
15
src/house.c
15
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");
|
||||
|
||||
Reference in New Issue
Block a user