Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 I am trying to compile smaugfuss1.8
Yesterday, 11:18 am
By Tyro
Resets not working.
May 19, 2013, 5:57 am
By Remcon
Compendium of bugs in SmaugFUSS
May 18, 2013, 8:42 am
By Remcon
SIGCONT?
May 13, 2013, 9:49 am
By Aurin
Try/Catch function?
May 10, 2013, 10:36 am
By Zeno
QSF Portal
Author: QSF Portal Team
Submitted by: Samson
Raspberry Pi Diff File
Author: Dretzile
Submitted by: Dretzile
Replacement mp_*_passage funcs
Author: Andril
Submitted by: Andril
g++ 4.6 unused variables patch
Author: diff
Submitted by: Andril
LOP 1.43
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Google, GudrunVZT, LyleRoyer, SusieGhf, Baiduspider, GracieUsh, FrankieSe, DwightEme

Members: 6
Guests: 31
Stats
Files
Topics
Posts
Members
Newest Member
440
3,577
18,328
3,952
RochelleR
Today's Birthdays
Gabriela6 (77), NicholeHu (83)
Related Links
Smaug Building Institute
» 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
Posts181
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 >>

 
Contact Us