Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot, Yahoo!

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » A few other issues
Forum Rules | Mark all | Recent Posts

A few other issues
< Newer Topic :: Older Topic > still around in the code? lol

Pages:<< prev 1 next >>
Post is unread #1 Aug 1, 2005, 9:38 am   Last edited Aug 1, 2005, 9:38 am by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

bug_buf isnt really used just defined.
fpReserve isn't needed.
fpLOG isn't needed.
Small issue with mud time since 30 % 7 will repeat normaly like day 29 of one month and day 1 of the next month have the same day_name because of this.

The easiest way to stop the day_name from repeating is to change the 30 to 28
In update.c
   if( time_info.day >= 30 )
   {
      time_info.day = 0;
      time_info.month++;
   }

   if( time_info.month >= 17 )
   {
      time_info.month = 0;
      time_info.year++;
   }

Change to
   if( time_info.day >= 28 )
   {
      time_info.day = 0;
      time_info.month++;
   }

   if( time_info.month >= 17 )
   {
      time_info.month = 0;
      time_info.year++;
   }



This part is kind of long but here ill shorten it up a bit
Use grep to find fpReserve, fpLOG, bug_buf and then remove all the stuff to
do with them. Or you can just look through this but if you have changed it the
grep is probably best :)
In mud.h
Find
extern char bug_buf[];
extern time_t current_time;
extern bool fLogAll;
extern FILE *fpReserve;
extern FILE *fpLOG;

Change that to
extern time_t current_time;
extern bool fLogAll;


In act_info.c
   if( !str_cmp( arg1, "save" ) )
   {
      FILE *fpout;

      log_string_plus( "Saving help.are...", LOG_NORMAL, LEVEL_GREATER );

      rename( "help.are", "help.are.bak" );
      fclose( fpReserve );
      if( ( fpout = fopen( "help.are", "w" ) ) == NULL )
      {
         bug( "hset save: fopen", 0 );
         perror( "help.are" );
         fpReserve = fopen( NULL_FILE, "r" );
         return;
      }

      fprintf( fpout, "#HELPS\n\n" );
      for( pHelp = first_help; pHelp; pHelp = pHelp->next )
         fprintf( fpout, "%d %s~\n%s~\n\n", pHelp->level, pHelp->keyword, help_fix( pHelp->text ) );

      fprintf( fpout, "0 $~\n\n\n#$\n" );
      fclose( fpout );
      fpReserve = fopen( NULL_FILE, "r" );
      send_to_char( "Saved.\n\r", ch );
      return;
   }

Change that to
   if( !str_cmp( arg1, "save" ) )
   {
      FILE *fpout;

      log_string_plus( "Saving help.are...", LOG_NORMAL, LEVEL_GREATER );

      rename( "help.are", "help.are.bak" );
      if( ( fpout = fopen( "help.are", "w" ) ) == NULL )
      {
         bug( "hset save: fopen", 0 );
         perror( "help.are" );
         return;
      }

      fprintf( fpout, "#HELPS\n\n" );
      for( pHelp = first_help; pHelp; pHelp = pHelp->next )
         fprintf( fpout, "%d %s~\n%s~\n\n", pHelp->level, pHelp->keyword, help_fix( pHelp->text ) );

      fprintf( fpout, "0 $~\n\n\n#$\n" );
      fclose( fpout );
      send_to_char( "Saved.\n\r", ch );
      return;
   }

In act_wiz.c find
void save_watchlist( void )
{
   WATCH_DATA *pwatch;
   FILE *fp;

   fclose( fpReserve );
   if( !( fp = fopen( SYSTEM_DIR WATCH_LIST, "w" ) ) )
   {
      bug( "Save_watchlist: Cannot open " WATCH_LIST, 0 );
      perror( WATCH_LIST );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

   for( pwatch = first_watch; pwatch; pwatch = pwatch->next )
      fprintf( fp, "%d %s~%s~%s~\n", pwatch->imm_level, pwatch->imm_name,
               pwatch->target_name ? pwatch->target_name : " ", pwatch->player_site ? pwatch->player_site : " " );
   fprintf( fp, "-1\n" );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
void save_watchlist( void )
{
   WATCH_DATA *pwatch;
   FILE *fp;

   if( !( fp = fopen( SYSTEM_DIR WATCH_LIST, "w" ) ) )
   {
      bug( "Save_watchlist: Cannot open " WATCH_LIST, 0 );
      perror( WATCH_LIST );
      return;
   }

   for( pwatch = first_watch; pwatch; pwatch = pwatch->next )
      fprintf( fp, "%d %s~%s~%s~\n", pwatch->imm_level, pwatch->imm_name,
               pwatch->target_name ? pwatch->target_name : " ", pwatch->player_site ? pwatch->player_site : " " );
   fprintf( fp, "-1\n" );
   fclose( fp );
   return;
}

Then find
void save_reserved( void )
{
   RESERVE_DATA *res;
   FILE *fp;

   fclose( fpReserve );
   if( !( fp = fopen( SYSTEM_DIR RESERVED_LIST, "w" ) ) )
   {
      bug( "Save_reserved: cannot open " RESERVED_LIST, 0 );
      perror( RESERVED_LIST );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }
   for( res = first_reserved; res; res = res->next )
      fprintf( fp, "%s~\n", res->name );
   fprintf( fp, "$~\n" );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
void save_reserved( void )
{
   RESERVE_DATA *res;
   FILE *fp;

   if( !( fp = fopen( SYSTEM_DIR RESERVED_LIST, "w" ) ) )
   {
      bug( "Save_reserved: cannot open " RESERVED_LIST, 0 );
      perror( RESERVED_LIST );
      return;
   }
   for( res = first_reserved; res; res = res->next )
      fprintf( fp, "%s~\n", res->name );
   fprintf( fp, "$~\n" );
   fclose( fp );
   return;
}

In ban.c find
void save_banlist( void )
{
   BAN_DATA *pban;
   FILE *fp;

   fclose( fpReserve );
   if( !( fp = fopen( SYSTEM_DIR BAN_LIST, "w" ) ) )
   {
      bug( "Save_banlist: Cannot open " BAN_LIST, 0 );
      perror( BAN_LIST );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

   /*
    * Print out all the site bans
    */

   for( pban = first_ban; pban; pban = pban->next )
   {
      fprintf( fp, "SITE\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d %d %d\n", pban->level, pban->duration,
               pban->unban_date, pban->prefix, pban->suffix, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }

   /*
    * Print out all the race bans
    */

   for( pban = first_ban_race; pban; pban = pban->next )
   {
      fprintf( fp, "RACE\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d\n", pban->level, pban->duration, pban->unban_date, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }

   /*
    * Print out all the class bans
    */

   for( pban = first_ban_class; pban; pban = pban->next )
   {
      fprintf( fp, "CLASS\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d\n", pban->level, pban->duration, pban->unban_date, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }
   fprintf( fp, "END\n" ); /* File must have an END even if empty */
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
void save_banlist( void )
{
   BAN_DATA *pban;
   FILE *fp;

   if( !( fp = fopen( SYSTEM_DIR BAN_LIST, "w" ) ) )
   {
      bug( "Save_banlist: Cannot open " BAN_LIST, 0 );
      perror( BAN_LIST );
      return;
   }

   /*
    * Print out all the site bans
    */

   for( pban = first_ban; pban; pban = pban->next )
   {
      fprintf( fp, "SITE\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d %d %d\n", pban->level, pban->duration,
               pban->unban_date, pban->prefix, pban->suffix, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }

   /*
    * Print out all the race bans
    */

   for( pban = first_ban_race; pban; pban = pban->next )
   {
      fprintf( fp, "RACE\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d\n", pban->level, pban->duration, pban->unban_date, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }

   /*
    * Print out all the class bans
    */

   for( pban = first_ban_class; pban; pban = pban->next )
   {
      fprintf( fp, "CLASS\n" );
      fprintf( fp, "%s~\n", pban->name );
      fprintf( fp, "%d %d %d %d\n", pban->level, pban->duration, pban->unban_date, pban->warn );
      fprintf( fp, "%s~\n%s~\n%s~\n", pban->ban_by, pban->ban_time, pban->note );
   }
   fprintf( fp, "END\n" ); /* File must have an END even if empty */
   fclose( fp );
   return;
}

In boards.c find
void write_board( BOARD_DATA * board )
{
   FILE *fp;
   char filename[256];
   NOTE_DATA *pnote;

   /*
    * Rewrite entire list.
    */
   fclose( fpReserve );
   sprintf( filename, "%s%s", BOARD_DIR, board->note_file );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      perror( filename );
   }
   else
   {
      for( pnote = board->first_note; pnote; pnote = pnote->next )
      {
         fprintf( fp,
"Sender  %s~\nDate    %s~\nTo      %s~\nSubject %s~\nVoting %d\nYesvotes %s~\nNovotes %s~\nAbstentions %s~\nText\n%s~\n\n",
        pnote->sender, pnote->date, pnote->to_list, pnote->subject, pnote->voting, pnote->yesvotes, pnote->novotes,
                  pnote->abstentions, pnote->text );
      }
      fclose( fp );
   }
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
void write_board( BOARD_DATA * board )
{
   FILE *fp;
   char filename[256];
   NOTE_DATA *pnote;

   /*
    * Rewrite entire list.
    */
   sprintf( filename, "%s%s", BOARD_DIR, board->note_file );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      perror( filename );
   }
   else
   {
      for( pnote = board->first_note; pnote; pnote = pnote->next )
      {
         fprintf( fp,
"Sender  %s~\nDate    %s~\nTo      %s~\nSubject %s~\nVoting %d\nYesvotes %s~\nNovotes %s~\nAbstentions %s~\nText\n%s~\n\n",
        pnote->sender, pnote->date, pnote->to_list, pnote->subject, pnote->voting, pnote->yesvotes, pnote->novotes,
                  pnote->abstentions, pnote->text );
      }
      fclose( fp );
   }
   return;
}

In build.c find
   sprintf( buf, "Saving %s...", tarea->filename );
   log_string_plus( buf, LOG_NORMAL, LEVEL_GREATER );

   sprintf( buf, "%s.bak", filename );
   rename( filename, buf );
   fclose( fpReserve );
   if( ( fpout = fopen( filename, "w" ) ) == NULL )
   {
      bug( "fold_area: fopen", 0 );
      perror( filename );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

   fprintf( fpout, "#AREA   %s~\n\n\n\n", tarea->name );

Change that to
   sprintf( buf, "Saving %s...", tarea->filename );
   log_string_plus( buf, LOG_NORMAL, LEVEL_GREATER );

   sprintf( buf, "%s.bak", filename );
   rename( filename, buf );
   if( ( fpout = fopen( filename, "w" ) ) == NULL )
   {
      bug( "fold_area: fopen", 0 );
      perror( filename );
      return;
   }

   fprintf( fpout, "#AREA   %s~\n\n\n\n", tarea->name );

Then find
   /*
    * END
    */
   fprintf( fpout, "#$\n" );
   fclose( fpout );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
   /*
    * END
    */
   fprintf( fpout, "#$\n" );
   fclose( fpout );
   return;
}

In clans.c find
   sprintf( filename, "%s%s", CLAN_DIR, clan->filename );

   fclose( fpReserve );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_clan: fopen", 0 );
      perror( filename );
   }
   else

Change that to
   sprintf( filename, "%s%s", CLAN_DIR, clan->filename );

   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_clan: fopen", 0 );
      perror( filename );
   }
   else

Then find
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
   }
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
   }
   fclose( fp );
   return;
}

Then find
   sprintf( filename, "%s%s", COUNCIL_DIR, council->filename );

   fclose( fpReserve );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_council: fopen", 0 );
      perror( filename );
   }

Change that to
   sprintf( filename, "%s%s", COUNCIL_DIR, council->filename );

   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_council: fopen", 0 );
      perror( filename );
   }

Then find
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );

   }
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );

   }
   fclose( fp );
   return;
}

Then find
   log_string( "Loading clans..." );

   sprintf( clanlist, "%s%s", CLAN_DIR, CLAN_LIST );
   fclose( fpReserve );
   if( ( fpList = fopen( clanlist, "r" ) ) == NULL )
   {
      perror( clanlist );
      exit( 1 );
   }

Change that to
   log_string( "Loading clans..." );

   sprintf( clanlist, "%s%s", CLAN_DIR, CLAN_LIST );
   if( ( fpList = fopen( clanlist, "r" ) ) == NULL )
   {
      perror( clanlist );
      exit( 1 );
   }

Then find
   }
   fclose( fpList );
   log_string( " Done clans " );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
   }
   fclose( fpList );
   log_string( " Done clans " );
   return;
}

Then find
   log_string( "Loading councils..." );

   sprintf( councillist, "%s%s", COUNCIL_DIR, COUNCIL_LIST );
   fclose( fpReserve );
   if( ( fpList = fopen( councillist, "r" ) ) == NULL )
   {
      perror( councillist );
      exit( 1 );
   }

Change that to
   log_string( "Loading councils..." );

   sprintf( councillist, "%s%s", COUNCIL_DIR, COUNCIL_LIST );
   if( ( fpList = fopen( councillist, "r" ) ) == NULL )
   {
      perror( councillist );
      exit( 1 );
   }

Then find
   }
   fclose( fpList );
   log_string( " Done councils " );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change that to
   }
   fclose( fpList );
   log_string( " Done councils " );
   return;
}

In comm.c
Find and remove
FILE *fpReserve;  /* Reserved file handle    */

Then Find and remove
   /*
    * Reserve two channels for our use.
    */
   if( ( fpReserve = fopen( NULL_FILE, "r" ) ) == NULL )
   {
      perror( NULL_FILE );
      exit( 1 );
   }
   if( ( fpLOG = fopen( NULL_FILE, "r" ) ) == NULL )
   {
      perror( NULL_FILE );
      exit( 1 );
   }

In db.c
Find and remove
char bug_buf[2 * MAX_INPUT_LENGTH];

Then Find and remove
FILE *fpLOG;

Then find
/*
 * Append a string to a file.
 */
void append_file( CHAR_DATA * ch, char *file, char *str )
{
   FILE *fp;

   if( IS_NPC( ch ) || str[0] == '\0' )
      return;

   fclose( fpLOG );
   if( ( fp = fopen( file, "a" ) ) == NULL )
   {
      perror( file );
      send_to_char( "Could not open the file!\n\r", ch );
   }
   else
   {
      fprintf( fp, "[%5d] %s: %s\n", ch->in_room ? ch->in_room->vnum : 0, ch->name, str );
      fclose( fp );
   }

   fpLOG = fopen( NULL_FILE, "r" );
   return;
}

Change that to
/*
 * Append a string to a file.
 */
void append_file( CHAR_DATA * ch, char *file, char *str )
{
   FILE *fp;

   if( IS_NPC( ch ) || str[0] == '\0' )
      return;

   if( ( fp = fopen( file, "a" ) ) == NULL )
   {
      perror( file );
      send_to_char( "Could not open the file!\n\r", ch );
   }
   else
   {
      fprintf( fp, "[%5d] %s: %s\n", ch->in_room ? ch->in_room->vnum : 0, ch->name, str );
      fclose( fp );
   }

   return;
}

Then find
void boot_log( const char *str, ... )
{
   char buf[MAX_STRING_LENGTH];
   FILE *fp;
   va_list param;

   strcpy( buf, "[*****] BOOT: " );
   va_start( param, str );
   vsprintf( buf + strlen( buf ), str, param );
   va_end( param );
   log_string( buf );

   fclose( fpLOG );
   if( ( fp = fopen( BOOTLOG_FILE, "a" ) ) != NULL )
   {
      fprintf( fp, "%s\n", buf );
      fclose( fp );
   }
   fpLOG = fopen( NULL_FILE, "r" );

   return;
}

Change that to
void boot_log( const char *str, ... )
{
   char buf[MAX_STRING_LENGTH];
   FILE *fp;
   va_list param;

   strcpy( buf, "[*****] BOOT: " );
   va_start( param, str );
   vsprintf( buf + strlen( buf ), str, param );
   va_end( param );
   log_string( buf );

   if( ( fp = fopen( BOOTLOG_FILE, "a" ) ) != NULL )
   {
      fprintf( fp, "%s\n", buf );
      fclose( fp );
   }

   return;
}

Then find
void show_file( CHAR_DATA * ch, char *filename )
{
   FILE *fp;
   char buf[MAX_STRING_LENGTH];
   int c;
   int num = 0;

   fclose( fpReserve );
   if( ( fp = fopen( filename, "r" ) ) != NULL )

Change it to
void show_file( CHAR_DATA * ch, char *filename )
{
   FILE *fp;
   char buf[MAX_STRING_LENGTH];
   int c;
   int num = 0;

   if( ( fp = fopen( filename, "r" ) ) != NULL )

Then find
      /*
       * Thanks to stu <sprice@ihug.co.nz> from the mailing list in pointing
       * *  This out.
       */
      fclose( fp );
   }
   fpReserve = fopen( NULL_FILE, "r" );
}

Change it to
      /*
       * Thanks to stu <sprice@ihug.co.nz> from the mailing list in pointing
       * *  This out.
       */
      fclose( fp );
   }
}

Then find
   sprintf( filename, "%ssysdata.dat", SYSTEM_DIR );

   fclose( fpReserve );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_sysdata: fopen" );
      perror( filename );
   }

Change it to
   sprintf( filename, "%ssysdata.dat", SYSTEM_DIR );

   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_sysdata: fopen" );
      perror( filename );
   }

Then find
      fprintf( fp, "Pkloot           %d\n", sys.pk_loot );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
   }
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change it to
      fprintf( fp, "Pkloot           %d\n", sys.pk_loot );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
   }
   fclose( fp );
   return;
}

In deity.c
Find
void write_deity_list(  )
{
   DEITY_DATA *tdeity;
   FILE *fpout;
   char filename[256];

   sprintf( filename, "%s%s", DEITY_DIR, DEITY_LIST );
   fclose( fpReserve );
   fpout = fopen( filename, "w" );
   if( !fpout )
      bug( "FATAL: cannot open deity.lst for writing!\n\r", 0 );
   else
   {
      for( tdeity = first_deity; tdeity; tdeity = tdeity->next )
         fprintf( fpout, "%s\n", tdeity->filename );
      fprintf( fpout, "$\n" );
      fclose( fpout );
   }
   fpReserve = fopen( NULL_FILE, "r" );
}

Change it to
void write_deity_list(  )
{
   DEITY_DATA *tdeity;
   FILE *fpout;
   char filename[256];

   sprintf( filename, "%s%s", DEITY_DIR, DEITY_LIST );
   fpout = fopen( filename, "w" );
   if( !fpout )
      bug( "FATAL: cannot open deity.lst for writing!\n\r", 0 );
   else
   {
      for( tdeity = first_deity; tdeity; tdeity = tdeity->next )
         fprintf( fpout, "%s\n", tdeity->filename );
      fprintf( fpout, "$\n" );
      fclose( fpout );
   }
}

Then find
   sprintf( filename, "%s%s", DEITY_DIR, deity->filename );

   fclose( fpReserve );
   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_deity: fopen", 0 );
      perror( filename );
   }

Change it to
   sprintf( filename, "%s%s", DEITY_DIR, deity->filename );

   if( ( fp = fopen( filename, "w" ) ) == NULL )
   {
      bug( "save_deity: fopen", 0 );
      perror( filename );
   }

Then find
      fprintf( fp, "Objstat             %d\n", deity->objstat );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
      fclose( fp );
   }
   fpReserve = fopen( NULL_FILE, "r" );
   return;
}

Change it to
      fprintf( fp, "Objstat             %d\n", deity->objstat );
      fprintf( fp, "End\n\n" );
      fprintf( fp, "#END\n" );
      fclose( fp );
   }
   return;
}

In hotboot.c
Find
   log_string( "Executing hotboot...." );
   /*
    * Close reserve and other always-open files and release other resources
    */
   fclose( fpReserve );
   fpReserve = NULL;
   fclose( fpLOG );
   fpLOG = NULL;

Change it to
   log_string( "Executing hotboot...." );

Then find and remove
   /*
    * Here you might want to reopen fpReserve
    */
   /*
    * Since I'm a neophyte type guy, I'll assume this is a good idea and cut and past from main()
    */

   if( !( fpReserve = fopen( NULL_FILE, "r" ) ) )
   {
      perror( NULL_FILE );
      exit( 1 );
   }
   if( !( fpLOG = fopen( NULL_FILE, "r" ) ) )
   {
      perror( NULL_FILE );
      exit( 1 );
   }

In imm_host.c
Find
   fclose( fpReserve );

   if( immortal_host_start == NULL )
   {
      unlink( IMM_HOST_FILE );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

   if( ( fp = fopen( IMM_HOST_FILE, "w" ) ) == NULL )
   {
      bug( "Do_write_imm_host: fopen", 0 );
      perror( IMM_HOST_FILE );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

   for( temp = immortal_host_start; temp; temp = temp->next )
   {
      fprintf( fp, "Start\n" );
      fprintf( fp, "Name\t%s~\n", temp->name );
      fprintf( fp, "Host\t%s~\n", temp->host );
      if( temp->prefix )
         fprintf( fp, "Prefix\t1\n" );
      if( temp->suffix )
         fprintf( fp, "Suffix\t1\n" );
      fprintf( fp, "End\n" );
   }
   fprintf( fp, "#END\n" );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;

Change it to

   if( immortal_host_start == NULL )
   {
      unlink( IMM_HOST_FILE );
      return;
   }

   if( ( fp = fopen( IMM_HOST_FILE, "w" ) ) == NULL )
   {
      bug( "Do_write_imm_host: fopen", 0 );
      perror( IMM_HOST_FILE );
      return;
   }

   for( temp = immortal_host_start; temp; temp = temp->next )
   {
      fprintf( fp, "Start\n" );
      fprintf( fp, "Name\t%s~\n", temp->name );
      fprintf( fp, "Host\t%s~\n", temp->host );
      if( temp->prefix )
         fprintf( fp, "Prefix\t1\n" );
      if( temp->suffix )
         fprintf( fp, "Suffix\t1\n" );
      fprintf( fp, "End\n" );
   }
   fprintf( fp, "#END\n" );
   fclose( fp );
   return;

In planes.c
Find
   fclose( fpReserve );

   if( !( fp = fopen( PLANE_FILE, "w" ) ) )
   {
      perror( PLANE_FILE );
      bug( "save_planes: can't open plane file" );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }

Change it to

   if( !( fp = fopen( PLANE_FILE, "w" ) ) )
   {
      perror( PLANE_FILE );
      bug( "save_planes: can't open plane file" );
      return;
   }

Then find
   fprintf( fp, "#END\n" );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;

Change it to
   fprintf( fp, "#END\n" );
   fclose( fp );
   return;

In save.c
Find
   fclose( fpReserve );
   if( ( fp = fopen( argument, "w" ) ) == NULL )
   {
      sprintf( buf, "Write_char_mobile: couldn't open %s for writing!\n\r", argument );
      bug( buf, 0 );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }
   mob = ch->pcdata->pet;
   xSET_BIT( mob->affected_by, AFF_CHARM );
   fwrite_mobile( fp, mob );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;

Change it to
   if( ( fp = fopen( argument, "w" ) ) == NULL )
   {
      sprintf( buf, "Write_char_mobile: couldn't open %s for writing!\n\r", argument );
      bug( buf, 0 );
      return;
   }
   mob = ch->pcdata->pet;
   xSET_BIT( mob->affected_by, AFF_CHARM );
   fwrite_mobile( fp, mob );
   fclose( fp );
   return;

Then find
   fclose( fpReserve );
   if( ( fp = fopen( argument, "r" ) ) == NULL )
   {
      sprintf( buf, "Read_char_mobile: couldn't open %s for reading!\n\r", argument );
      bug( buf, 0 );
      fpReserve = fopen( NULL_FILE, "r" );
      return;
   }
   mob = fread_mobile( fp );
   fclose( fp );
   fpReserve = fopen( NULL_FILE, "r" );
   return;

Change it to
   if( ( fp = fopen( argument, "r" ) ) == NULL )
   {
      sprintf( buf, "Read_char_mobile: couldn't open %s for reading!\n\r", argument );
      bug( buf, 0 );
      return;
   }
   mob = fread_mobile( fp );
   fclose( fp );
   return;

       
Post is unread #2 Aug 1, 2005, 9:52 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Oh and the stuff about fpreserve and all of them were mentioned a very long time ago on MUDPlanet forums, if you happen to have an old copy of them credit who ever brought it up first, if not give credit to the community for finding it since I dont remember who found it orginialy. :)
       
Post is unread #3 Aug 2, 2005, 2:51 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I think Orion originally found the fpReserve and fpLOG stuff and I found the bug_buf thing when I was cleaning out AFKMud but both were from before the FUSS project got started. Technically not bugs either, so they won't be on the list, but I will go ahead and remove them anyway.

As for the day_name fix, that would be considered a minor bug and will get a list entry for it later.
       
Post is unread #4 Aug 2, 2005, 6:54 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

K, works for me. Mainly put it all here so others could remove that stuff if they wanted to since its not really needed. :)
       
Pages:<< prev 1 next >>