void load_area_file( FILE * fp )
{
char *word = NULL;
int version = 0;
if ( fp == stdin )
{
/*
* We can't fseek here, so assume it's OLD format!
*/
load_rom_area_file( fp );
return;
}
if ( fread_letter( fpArea ) != '#' )
{
proper_exit( MUD_HALT, "Boot_db: # not found." );
}
word = fread_word( fpArea );
if ( str_cmp( word, "VERSION" ) )
{
/*
* If the first line isn't #VERSION, this is an old format file.
*/
rewind( fp );
load_rom_area_file( fp );
return;
}
version = fread_number( fp );
load_ram_area_file( fp, version );
}
if ( !ch->version )
fprintf( fp, "Version %d~\n", SAVEVERSION );
if ( !ch->version )
KEY ("Version", ch->version, fread_number (fp));
Sun Oct 3 19:15:13 2010 :: [*****] BUG: Version
Program received signal SIGINT, Interrupt.
0xf57fe416 in __kernel_vsyscall ()
(gdb) bt
#0 0xf57fe416 in __kernel_vsyscall ()
#1 0xb7f1b093 in __read_nocancel () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7ec4fbb in _IO_new_file_underflow (fp=0x81bf1b0) at fileops.c:605
#3 0xb7ec684b in _IO_default_uflow (fp=0x81bf1b0) at genops.c:440
#4 0xb7ec7c78 in *__GI___uflow (fp=0x81bf1b0) at genops.c:394
#5 0xb7ebd56c in _IO_getc (fp=0x81bf1b0) at getc.c:41
#6 0x0807ab16 in fread_to_eol (fp=0x81bf1b0) at db.c:3090
#7 0x080a8376 in fread_char (ch=0xb7025d18, fp=0x81bf1b0) at save.c:1111
#8 0x080a9bfc in load_char_obj (d=0xb6c604fc, name=0xb6c60799 "Rao") at save.c:677
#9 0x08075df0 in nanny (d=0xb6c604fc, argument=0xb6c60799 "Rao") at comm.c:2659
#10 0x0807877b in game_loop_unix (control=6) at comm.c:930
#11 0x08078deb in main (argc=1, argv=0x0) at comm.c:527
#6 0x0807ab16 in fread_to_eol (fp=0x81bf1b0) at db.c:3090
3090 c = getc (fp);
(gdb) list
3085 {
3086 char c;
3087
3088 do
3089 {
3090 c = getc (fp);
3091 }
3092 while (c != '\n' && c != '\r');
3093
3094 do
(gdb) frame 7
#7 0x080a8376 in fread_char (ch=0xb7025d18, fp=0x81bf1b0) at save.c:1111
1111 fread_to_eol( fp );
(gdb) list
1106 ch->exp = xp_for_level(ch,ch->level +1)-1;
1107 if ( !fMatch )
1108 {
1109 sprintf(buf,"Fread_char(): no match '%s'",word);
1110 bug( word, 0 );
1111 fread_to_eol( fp );
1112 } // end if
1113 } // end for
1114 } // end proc
1115
(gdb)
if ( str_cmp( word, "Version" ) )
{
ch->version = fread_number (fp);
fMatch = TRUE;
break;
}
break;
fprintf( fp, "Version %d~\n", SAVEVERSION );
fprintf( fp, "Version %d\n", SAVEVERSION );
This wouldn't need to be done in the game persay, but a bash command or something that I could configure and run through the player/letter folders.
Looking for ideas.