Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Sogou

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,396
629
DarrenPayn
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 >>