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, DotBot

Members: 0
Guests: 8
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 » SWFOTE FUSS » Sw:FotE Ship Bug
Forum Rules | Mark all | Recent Posts

Sw:FotE Ship Bug
< Newer Topic :: Older Topic > Reposted from closed poll

Pages:<< prev 1 next >>
Post is unread #1 Nov 16, 2003, 7:11 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

The following was posted by Deathbringer in the poll topic for SW:FotE and has been moved here so the poll doesn't stay alive any longer.

------------

Heres something new :P

buyship skipray Flamethrower


And then mud Crashed.. Heres a Core Dump that i received from it.. I'm sure it wasen't my fault...


Program received signal SIGSEGV, Segmentation fault.
0x0809840d in strip_cr (str=0x0) at build.c:666
666 for ( i=j=0; str[i] != '\0'; i++ )
(gdb) bt
#0 0x0809840d in strip_cr (str=0x0) at build.c:666
#1 0x080a7659 in fold_area (tarea=0x849f5e8, filename=0x849f6b0 "shipvnum.are",
install=0 '\0') at build.c:5972
#2 0x081990bc in make_prototype_rooms (ship_type=14, vnum=12001, tarea=0x849f5e8,
Sname=0xbfffdde0 "Flamethrower (GAT-12j)";) at ships.c:1066
#3 0x08197f49 in do_ordership (ch=0x85db4b0,
argument=0xbfffdde0 "Flamethrower (GAT-12j)";) at ships.c:802
#4 0x080e7d39 in interpret (ch=0x85db4b0,
argument=0xbfffddd8 "skipray Flamethrower (GAT-12j)";) at interp.c:411
#5 0x080b83d8 in game_loop () at comm.c:598
#6 0x080b7808 in main (argc=2, argv=0xbfffe254) at comm.c:264
#7 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6


Theres the Core, Thanks for your time, Sorry about the trouble..



<!--EDIT|Samson|Nov 16 2003, 08:12 AM-->
       
Post is unread #2 Nov 16, 2003, 7:19 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'm a bit confused by your coredump as to how "Flamethrower" becomes "Flamethrower (GAT-12j)" before the code reaches the do_ordership function. There doesn't appear to be any logical way for this to have happened unless you actually typed that on the command line with it.

Now, near as I can figure, it's got some kind of issue with making some sort of rooms to go with the ship?

As for why it crashed:


#0 0x0809840d in strip_cr (str=0x0) at build.c:666


Whatever string it was trying to strip_cr on is NULL, meaning that's your real problem. Which in this particular case appears to be a room description associated with the ship somehow.

Also - as I'm sure you're now noticing, your shipvnum.are file will have become corrupted because it crashed while writing it. There's mention in the readme about how to fix that should it happen, so you'll need to take care of that now.
       
Post is unread #3 Nov 16, 2003, 7:53 am
Go to the top of the page
Go to the bottom of the page

Deathbringer
Full Member
GroupMembers
Posts20
JoinedSep 6, 2003

Well.. i don't know anymore..

I've got a email from someone else saying they are having the same problem with buying ships, but.. i don't really know what to belive anymore..

It's driving me insane..

Peace, if someone could maybe tell me what i'm doing wrong that' help out

Thanks.



<!--EDIT|Deathbringer|Nov 18 2003, 01:25 AM-->
       
Post is unread #4 Nov 19, 2003, 11:21 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Buying a ship crashes the game and corrupts the shipvnums.are file.
Danger: Extreme
Found by: Deathbringer
Fixed by: Samson

ships.c, function do_ordership

Find the following:
    sprintf(argument,"%s (%s)",argument, ship_prototypes[ship_type].sname);
    for ( ship = first_ship; ship; ship = ship->next )
    {   
        if(!str_cmp(ship->name,argument))
        {
        send_to_char("&CThat ship name is already in use. Choose another.\r\n",ch);
          return;
        }
    }


Replace it with the following:
    sprintf( log_buf, ship_prototypes[ship_type].sname );
    for ( ship = first_ship; ship; ship = ship->next )
    {   
        if( !str_cmp( ship->name, log_buf ) )
        {
        send_to_char("&CThat ship name is already in use. Choose another.\r\n",ch);
          return;
        }
    }


build.c, function fold_area:

Find the following:
	fprintf( fpout, "#%d\n",	vnum    );
	fprintf( fpout, "%s~\n",	room->name  	);
	fprintf( fpout, "%s~\n",	strip_cr( room->description )	);


Replace it with the following:
	fprintf( fpout, "#%d\n",	vnum    );
	fprintf( fpout, "%s~\n",	room->name  	);
      if( !room->description || room->description[0] == '\0' )
         fprintf( fpout, "%s", "~\n" );
      else
         fprintf( fpout, "%s~\n", strip_cr( room->description ) );


The error is twofold here. First, the do_ordership function was altering the contents of "argument" which contained the name of the ship the user was trying to buy. This is a supremely BAD THING&#153; to do.

Secondly, the room descriptions for the resulting ship don't appear to always be created. So when it tried to fold the area even with the proper changes to the name it would crash and write a shipvnums.are file with 0 bytes.

For whoever is going to maintain the formal list, this should be your first entry :)
       
Pages:<< prev 1 next >>