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

Members: 0
Guests: 6
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 » AFKMud Support & Development » AFKMUD 2.14 oset issue
Forum Rules | Mark all | Recent Posts

AFKMUD 2.14 oset issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 19, 2012, 1:54 pm   Last edited Mar 20, 2012, 6:01 pm by Samson
Go to the top of the page
Go to the bottom of the page

Sherm
Fledgling
GroupMembers
Posts33
JoinedDec 20, 2010

I recent was trying to add new affect and i noticed a bug in the code.
  if( !str_cmp( arg2, "affect" ) )
   {
      affect_data *paf;
      bitset < MAX_RIS_FLAG > risabit;
      short loc;
      bool found = false;

      risabit.reset(  );

       //argument = one_argument( argument, arg2 );
      argument = one_argument( argument, arg3 );
      arg4 = argument;
      //if( arg2.empty(  ) || argument.empty(  ) )
      if( arg3.empty(  ) || argument.empty(  ) )
      {
         ch->print( "Usage: oset <object> affect <field> <value>\r\n" );
         return;
      }
      //loc = get_atype( arg2 );
      loc = get_atype( arg3 );
      if( loc < 1 )
      {
         //ch->printf( "Unknown field: %s\r\n", arg2.c_str(  ) );
          ch->printf( "Unknown field: %s\r\n", arg3.c_str(  ) );
         return;
      }
      if( loc == APPLY_AFFECT )
      {
         argument = one_argument( argument, arg3 );
         if( loc == APPLY_AFFECT )
         {
            value = get_aflag( arg3 );

            if( value < 0 || value >= MAX_AFFECTED_BY )
               ch->printf( "Unknown affect: %s\r\n", arg3.c_str(  ) );
            else
               found = true;
         }
      }
      else if( loc == APPLY_RESISTANT || loc == APPLY_IMMUNE || loc == APPLY_SUSCEPTIBLE || loc == APPLY_ABSORB )
      {
         string flag;
         //while( !arg3.empty(  ) )
         while( !arg4.empty(  ) )
         {
            //arg3 = one_argument( arg3, flag );
             arg4 = one_argument( arg4, flag );
            value = get_risflag( flag );

            if( value < 0 || value >= MAX_RIS_FLAG )
               ch->printf( "Unknown flag: %s\r\n", flag.c_str(  ) );
            else
            {
               risabit.set( value );
               found = true;
            }
         }
      }
      else if( loc == APPLY_WEAPONSPELL
               || loc == APPLY_WEARSPELL || loc == APPLY_REMOVESPELL || loc == APPLY_STRIPSN || loc == APPLY_RECURRINGSPELL || loc == APPLY_EAT_SPELL )
      {
       
	//ch->printf( "Value of Arg3  check: %s\r\n", value  );
	argument = one_argument ( argument, arg3);
	//ch->printf( "Value of Arg3  check: %s\r\n", value  );
	value = skill_lookup( arg3 );
	//ch->printf( "Value of Arg3 after lookup check: %d\r\n", value  );
	 if( !IS_VALID_SN( value ) )
	 {
	   ch->printf( "Invalid spell: %s\r\n", arg3.c_str(  ) );
	   //ch->printf( "Invalid spell: %s\r\n", arg3.c_str(  ) );
	   //ch->printf( "Value of Value: %d\r\n", value  );
	 }
	  else
            found = true;
      }
      else
      {
         //value = atoi( arg3.c_str(  ) );
          value = atoi( arg4.c_str(  ) );
         found = true;
      }
      if( !found )
         return;

      paf = new affect_data;
      paf->type = -1;
      paf->duration = -1;
      paf->location = loc;
      paf->modifier = value;
      paf->rismod = risabit;
      paf->bit = 0;
      if( obj->extra_flags.test( ITEM_PROTOTYPE ) )
      {
         if( loc != APPLY_WEARSPELL && loc != APPLY_REMOVESPELL && loc != APPLY_STRIPSN && loc != APPLY_WEAPONSPELL )
         {
            list < char_data * >::iterator ich;
            list < obj_data * >::iterator iobj;

            for( ich = charlist.begin(  ); ich != charlist.end(  ); ++ich )
            {
               char_data *vch = *ich;

               for( iobj = vch->carrying.begin(  ); iobj != vch->carrying.end(  ); ++iobj )
               {
                  obj_data *eq = *iobj;

                  if( eq->pIndexData == obj->pIndexData && eq->wear_loc != WEAR_NONE )
                     vch->affect_modify( paf, true );
               }
            }
         }
         obj->pIndexData->affects.push_back( paf );
      }
      else
         obj->affects.push_back( paf );
      ++top_affect;
      ch->print( "Object affect added.\r\n" );
      return;
   }
       
Post is unread #2 Mar 19, 2012, 6:38 pm
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

You might want to point out what the bug is and why it's a bug. And whether or not you fixed the bug and/or looking for help.
       
Post is unread #3 Mar 20, 2012, 5:01 am
Go to the top of the page
Go to the bottom of the page

Sherm
Fledgling
GroupMembers
Posts33
JoinedDec 20, 2010

Sorry about that I did not think I posted this yet. I started last night then ended up working on another issue.

This bug never passes all the arguments through. They needed to be incremented by 1.
       
Pages:<< prev 1 next >>