mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-23 02:30:13 +01:00
fixed a bunch of strange bugs in objsave.c - how did we ever get that to compile? - and altered build_player_index() to conform to gcc 4.1 standards. This mainly consisted of removing a cast which was not needed. Todo: Fix up objsave.c - it's a mess atm.
This commit is contained in:
parent
1be1fc39d7
commit
f33141db5b
2 changed files with 9 additions and 21 deletions
|
|
@ -379,7 +379,6 @@ int Crash_delete_file(char *name)
|
||||||
int Crash_delete_crashfile(struct char_data *ch)
|
int Crash_delete_crashfile(struct char_data *ch)
|
||||||
{
|
{
|
||||||
char fname[MAX_INPUT_LENGTH];
|
char fname[MAX_INPUT_LENGTH];
|
||||||
struct rent_info rent;
|
|
||||||
int numread;
|
int numread;
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
int rentcode,timed,netcost,gold,account,nitems;
|
int rentcode,timed,netcost,gold,account,nitems;
|
||||||
|
|
@ -403,9 +402,6 @@ int Crash_delete_crashfile(struct char_data *ch)
|
||||||
if (rentcode == RENT_CRASH)
|
if (rentcode == RENT_CRASH)
|
||||||
Crash_delete_file(GET_NAME(ch));
|
Crash_delete_file(GET_NAME(ch));
|
||||||
|
|
||||||
if (rent.rentcode == RENT_CRASH)
|
|
||||||
Crash_delete_file(GET_NAME(ch));
|
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -413,7 +409,6 @@ int Crash_delete_crashfile(struct char_data *ch)
|
||||||
int Crash_clean_file(char *name)
|
int Crash_clean_file(char *name)
|
||||||
{
|
{
|
||||||
char fname[MAX_STRING_LENGTH], filetype[20];
|
char fname[MAX_STRING_LENGTH], filetype[20];
|
||||||
struct rent_info rent;
|
|
||||||
int numread;
|
int numread;
|
||||||
FILE *fl;
|
FILE *fl;
|
||||||
int rentcode, timed, netcost, gold, account, nitems;
|
int rentcode, timed, netcost, gold, account, nitems;
|
||||||
|
|
@ -439,9 +434,6 @@ int Crash_clean_file(char *name)
|
||||||
sscanf(line, "%d %d %d %d %d %d",&rentcode,&timed,&netcost,
|
sscanf(line, "%d %d %d %d %d %d",&rentcode,&timed,&netcost,
|
||||||
&gold,&account,&nitems);
|
&gold,&account,&nitems);
|
||||||
|
|
||||||
rentcode = rent.rentcode;
|
|
||||||
timed = rent.time;
|
|
||||||
|
|
||||||
if ((rentcode == RENT_CRASH) ||
|
if ((rentcode == RENT_CRASH) ||
|
||||||
(rentcode == RENT_FORCED) || (rentcode == RENT_TIMEDOUT)) {
|
(rentcode == RENT_FORCED) || (rentcode == RENT_TIMEDOUT)) {
|
||||||
if (timed < time(0) - (crash_file_timeout * SECS_PER_REAL_DAY)) {
|
if (timed < time(0) - (crash_file_timeout * SECS_PER_REAL_DAY)) {
|
||||||
|
|
@ -490,7 +482,6 @@ void Crash_listrent(struct char_data *ch, char *name)
|
||||||
char fname[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
|
char fname[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
|
||||||
/* struct obj_file_elem object; */
|
/* struct obj_file_elem object; */
|
||||||
struct obj_data *obj;
|
struct obj_data *obj;
|
||||||
struct rent_info rent;
|
|
||||||
int rentcode,timed,netcost,gold,account,nitems;
|
int rentcode,timed,netcost,gold,account,nitems;
|
||||||
int nr;
|
int nr;
|
||||||
char line[MAX_STRING_LENGTH];
|
char line[MAX_STRING_LENGTH];
|
||||||
|
|
@ -517,8 +508,6 @@ void Crash_listrent(struct char_data *ch, char *name)
|
||||||
sscanf(line,"%d %d %d %d %d %d",&rentcode,&timed,&netcost,
|
sscanf(line,"%d %d %d %d %d %d",&rentcode,&timed,&netcost,
|
||||||
&gold,&account,&nitems);
|
&gold,&account,&nitems);
|
||||||
|
|
||||||
rentcode=rent.rentcode;
|
|
||||||
|
|
||||||
switch (rentcode) {
|
switch (rentcode) {
|
||||||
case RENT_RENTED:
|
case RENT_RENTED:
|
||||||
strcat(buf, "Rent\r\n");
|
strcat(buf, "Rent\r\n");
|
||||||
|
|
@ -716,8 +705,7 @@ void Crash_crashsave(struct char_data *ch)
|
||||||
rent.rentcode = RENT_CRASH;
|
rent.rentcode = RENT_CRASH;
|
||||||
rent.time = time(0);
|
rent.time = time(0);
|
||||||
|
|
||||||
fprintf(fp,"%d %d %d %d %d %d\r\n",rent.rentcode,rent.time,
|
fprintf(fp,"%d %d 0 0 0 0\r\n",rent.rentcode,rent.time);
|
||||||
rent.net_cost_per_diem,rent.gold,rent.account,rent.nitems);
|
|
||||||
|
|
||||||
for (j = 0; j < NUM_WEARS; j++)
|
for (j = 0; j < NUM_WEARS; j++)
|
||||||
if (GET_EQ(ch, j)) {
|
if (GET_EQ(ch, j)) {
|
||||||
|
|
@ -798,8 +786,8 @@ void Crash_idlesave(struct char_data *ch)
|
||||||
rent.gold = GET_GOLD(ch);
|
rent.gold = GET_GOLD(ch);
|
||||||
rent.account = GET_BANK_GOLD(ch);
|
rent.account = GET_BANK_GOLD(ch);
|
||||||
|
|
||||||
fprintf(fp,"%d %d %d %d %d %d\r\n",rent.rentcode,rent.time,
|
fprintf(fp,"%d %d %d %d %d 0\r\n",rent.rentcode,rent.time,
|
||||||
rent.net_cost_per_diem,rent.gold,rent.account,rent.nitems);
|
rent.net_cost_per_diem,rent.gold,rent.account);
|
||||||
|
|
||||||
for (j = 0; j < NUM_WEARS; j++) {
|
for (j = 0; j < NUM_WEARS; j++) {
|
||||||
if (GET_EQ(ch, j)) {
|
if (GET_EQ(ch, j)) {
|
||||||
|
|
@ -847,8 +835,8 @@ void Crash_rentsave(struct char_data *ch, int cost)
|
||||||
rent.gold = GET_GOLD(ch);
|
rent.gold = GET_GOLD(ch);
|
||||||
rent.account = GET_BANK_GOLD(ch);
|
rent.account = GET_BANK_GOLD(ch);
|
||||||
|
|
||||||
fprintf(fp,"%d %d %d %d %d %d\r\n",rent.rentcode,rent.time,
|
fprintf(fp,"%d %d %d %d %d 0\r\n",rent.rentcode,rent.time,
|
||||||
rent.net_cost_per_diem,rent.gold,rent.account,rent.nitems);
|
rent.net_cost_per_diem,rent.gold,rent.account);
|
||||||
|
|
||||||
for (j = 0; j < NUM_WEARS; j++)
|
for (j = 0; j < NUM_WEARS; j++)
|
||||||
if (GET_EQ(ch, j)) {
|
if (GET_EQ(ch, j)) {
|
||||||
|
|
@ -898,8 +886,8 @@ void Crash_cryosave(struct char_data *ch, int cost)
|
||||||
rent.account = GET_BANK_GOLD(ch);
|
rent.account = GET_BANK_GOLD(ch);
|
||||||
rent.net_cost_per_diem = 0;
|
rent.net_cost_per_diem = 0;
|
||||||
|
|
||||||
fprintf(fp,"%d %d %d %d %d %d\r\n",rent.rentcode,rent.time,
|
fprintf(fp,"%d %d %d %d %d 0\r\n",rent.rentcode,rent.time,
|
||||||
rent.net_cost_per_diem,rent.gold,rent.account,rent.nitems);
|
rent.net_cost_per_diem,rent.gold,rent.account);
|
||||||
|
|
||||||
|
|
||||||
for (j = 0; j < NUM_WEARS; j++)
|
for (j = 0; j < NUM_WEARS; j++)
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,8 @@ void build_player_index(void)
|
||||||
CREATE(player_table, struct player_index_element, rec_count);
|
CREATE(player_table, struct player_index_element, rec_count);
|
||||||
for (i = 0; i < rec_count; i++) {
|
for (i = 0; i < rec_count; i++) {
|
||||||
get_line(plr_index, line);
|
get_line(plr_index, line);
|
||||||
sscanf(line, "%ld %s %d %s %d", &player_table[i].id, arg2,
|
sscanf(line, "%ld %s %d %s %ld", &player_table[i].id, arg2,
|
||||||
&player_table[i].level, bits, (int *)&player_table[i].last);
|
&player_table[i].level, bits, &player_table[i].last);
|
||||||
CREATE(player_table[i].name, char, strlen(arg2) + 1);
|
CREATE(player_table[i].name, char, strlen(arg2) + 1);
|
||||||
strcpy(player_table[i].name, arg2);
|
strcpy(player_table[i].name, arg2);
|
||||||
player_table[i].flags = asciiflag_conv(bits);
|
player_table[i].flags = asciiflag_conv(bits);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue