Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 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, Bing, Yahoo!

Members: 0
Guests: 5
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 » redit ex_flags <flag> goes BO...
Forum Rules | Mark all | Recent Posts

redit ex_flags <flag> goes BOOM!
< Newer Topic :: Older Topic > NOTE THE UNDERSCORE!

Pages:<< prev 1 next >>
Post is unread #1 Dec 2, 2006, 4:15 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

   if( !str_cmp( arg, "ex_flags" ) )
   {
      argument = one_argument( argument, arg2 );

      value = get_exflag( arg2 );
      if( value < 0 )
      {
         send_to_char( "Bad exit flag. \r\n", ch );
         return;
      }
      if( ( xit = get_exit( location, edir ) ) == NULL )
      {
         snprintf( buf, MAX_STRING_LENGTH, "exit %c 1", dir );
         do_redit( ch, buf );
         xit = get_exit( location, edir );
      }
      TOGGLE_BIT( xit->exit_info, 1 << value );
      return;
   }


This lovely bit of code is in do_redit, build.c, and from what I can tell is abandoned. It's not revealed in the syntax message or in the help for redit. It appears the intent was to take a single exit flag, and apply it to the specified exit, creating that exit if it doesn't already exist. But careful examination shows it never asks for the direction of this exit, and so it just assumes north in all cases. If there is no north exit in the room, it'll crash the program.

My feeling is this code was not intended to remain in use since it's not documented. So abuse carefully. I'd recommend removing it if you find it.
       
Post is unread #2 Dec 2, 2006, 6:02 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

When I grep for ex_flags in my code, grep returns:
[conner@speedy src]$ grep ex_flags * -n
act_wiz.c:83:extern char *const ex_flags[];
build.c:71:char *const ex_flags[] = {
build.c:560:   for( x = 0; x < ( sizeof( ex_flags ) / sizeof( ex_flags[0] ) ); x++ )
build.c:561:      if( !str_cmp( flag, ex_flags[x] ) )
build.c:4926:               strcat( buf, ex_flags[value] );
build.c:4976:             xit->keyword, xit->key, flag_string( xit->exit_info, ex_flags ) );
build.c:4979:                        texit->keyword, texit->key, flag_string( texit->exit_info, ex_flags ) );
build.c:4998:   if( !str_cmp( arg, "ex_flags" ) )
build.c:6563:         fprintf( fpout, "Flags     %s~\n", flag_string( xit->exit_info, ex_flags ) );
which makes me ask, before I just arbitrarily delete that section of code (noting that the code section in question is the one labelled here as build.c:4998:), are we certain that none of the other code that contains the same term is calling that as a sub function of sorts?
       
Post is unread #3 Dec 2, 2006, 6:28 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

We are certain. The section I posted is only called by the redit command, and only by human action. It's safe to remove as is, but don't go disturbing the string "ex_flags" anywhere else or you'll probably regret it :P
       
Post is unread #4 Dec 2, 2006, 7:09 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Ok, just read Remcon's version of this fix on his LoP forums, even more drastic, but basically says the same thing.. what are your thoughts about the rest of the sections he's suggesting need to be removed: ex_to_room, ex_key, ex_exdesc, & ex_keywords?
       
Post is unread #5 Dec 2, 2006, 8:19 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Ok, after consuming a meal of seared cow and pig flesh with cheese.....

I checked back in the stock 1.4a code and found that the ex_* options which are being looked at were from the old ibuild.c code which got removed a long time ago because it didn't work worth a crap. Just looks like when it was removed I didn't fully understand what the rest of the conditions did, and looking at it now removing them all makes perfect sense since they're just orphaned chunks of code now.
       
Post is unread #6 Dec 2, 2006, 8:54 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Ah, now it all becomes much clearer. Ok, I'll remove all five blocks from my code. Thanks for the quick research. Hope your bovine porcine meal was good. :grinning:
       
Pages:<< prev 1 next >>