Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
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

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » A continuation of the name an...
Forum Rules | Mark all | Recent Posts

A continuation of the name and filename/name setting bugfix
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 25, 2006, 7:55 pm   Last edited Sep 25, 2006, 7:57 pm by Keberus
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

These are just two other scenarios that need the other bugfix applied. **You MUST have the other bugfix in place to do this one**. One other thing, since FotEFUSS took out the ability to set the filename with do_setstarsystem you might wanna remove it from the listing of possibilities.

in space.c do_setstarsystem find:
   if( !str_cmp( arg2, "name" ) )
   {
      STRFREE( starsystem->name );
      starsystem->name = STRALLOC( argument );
      send_to_char( "Done.\r\n", ch );
      save_starsystem( starsystem );
      return;
   }


and change to:
   if( !str_cmp( arg2, "name" ) )
   {
      SPACE_DATA *tstarsystem = NULL;

      if( !argument || argument[0] == '\0' )
      {
         send_to_char( "You can't name a starsystem nothing.\r\n", ch );
         return;
      }
      if( ( tstarsystem = starsystem_from_name( argument ) ) != NULL )
      {
         send_to_char( "There is already another starsystem with that name.\r\n", ch );
         return;
      }
      STRFREE( starsystem->name );
      starsystem->name = STRALLOC( argument );
      send_to_char( "Done.\n\r", ch );
      save_starsystem( starsystem );
      return;
   }


in the same file in do_setship
find:
   if( !str_cmp( arg2, "name" ) )
   {
      STRFREE( ship->name );
      ship->name = STRALLOC( argument );
      send_to_char( "Done.\r\n", ch );
      save_ship( ship );
      return;
   }

   if( !str_cmp( arg2, "filename" ) )
   {
      DISPOSE( ship->filename );
      ship->filename = str_dup( argument );
      send_to_char( "Done.\r\n", ch );
      save_ship( ship );
      write_ship_list(  );
      return;
   }


   if( !str_cmp( arg2, "name" ) )
   {
      SHIP_DATA *uship = NULL;
      if( !argument || argument[0] == '\0' )
      {
         send_to_char( "You can't name a ship nothing.\r\n", ch );
         return;
      }
      if( ( uship = get_ship( argument ) ) != NULL  )
      {
         send_to_char( "There is already another ship with that name.\r\n", ch );
         return;
      }
      STRFREE( ship->name );
      ship->name = STRALLOC( argument );
      send_to_char( "Done.\n\r", ch );
      save_ship( ship );
      return;
   }

   if( !str_cmp( arg2, "filename" ) )
   {
      char filename[256];

      if( !is_valid_filename( ch, SHIP_DIR, argument ) )
         return;

      snprintf( filename, sizeof( filename ), "%s%s", SHIP_DIR, ship->filename );
      if( !remove( filename ) )
         send_to_char( "Old ship file deleted.\r\n", ch );

      DISPOSE( ship->filename );
      ship->filename = str_dup( argument );
      send_to_char( "Done.\n\r", ch );
      save_ship( ship );
      write_ship_list(  );
      return;
   }


This basically secures these two functions as well.

Peace,
KeB
       
Pages:<< prev 1 next >>