Login
User Name:

Password:



Register

Forgot your password?
 AFKMud 2.2.5
Jan 8, 2025 5:04 pm
By Samson
 sting skill
Jan 8, 2025 2:40 pm
By Samson
south command
Jan 7, 2025 7:22 pm
By Remcon
mphate
Jan 7, 2025 7:16 pm
By Remcon
do_setliquid
Jan 7, 2025 3:22 pm
By Remcon
SWFotEFUSS 1.5.2
Author: Various
Submitted by: Samson
SWRFUSS 1.4.2
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.6
Author: Various
Submitted by: Samson
AFKMud 2.2.5
Author: AFKMud Team
Submitted by: Samson
Help.are for SmaugFUSS1.9.5
Author: Smaug
Submitted by: Remcon
Users Online
Anthropic, Google, Bing, Remcon

Members: 1
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
499
3,820
19,760
589
SuzetteBea

» SmaugMuds » Codebases » SmaugFUSS » num_skills possible issue.
Forum Rules | Mark all | Recent Posts

num_skills possible issue.
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 5, 2025 12:52 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,988
JoinedJul 26, 2005

 
in tables.c you'll find this function. notice the sn <= num_skills in the for loop everywhere else it is just < num_skills.
void remap_slot_numbers(  )
{
   SKILLTYPE *skill;
   SMAUG_AFF *aff;
   char tmp[32];
   int sn;

   log_string( "Remapping slots to sns" );

   for( sn = 0; sn <= num_skills; ++sn )
   {
      if( ( skill = skill_table[sn] ) != NULL )
      {
         for( aff = skill->first_affect; aff; aff = aff->next )
            if( aff->location == APPLY_WEAPONSPELL
                || aff->location == APPLY_WEARSPELL
                || aff->location == APPLY_REMOVESPELL
                || aff->location == APPLY_STRIPSN || aff->location == APPLY_RECURRINGSPELL )
            {
               snprintf( tmp, 32, "%d", slot_lookup( atoi( aff->modifier ) ) );
               DISPOSE( aff->modifier );
               aff->modifier = str_dup( tmp );
            }
      }
   }
}

Post is unread #2 Jan 6, 2025 4:23 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,715
JoinedJan 1, 2002

 
I wonder what the point of that function even is, but good catch. Once someone managed to hit 500 skills on their MUD it would have gone beyond the end of the array.

FWIW, this was added in Smaug 1.4.

Post is unread #3 Jan 6, 2025 5:38 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,988
JoinedJul 26, 2005

 
Lol I went and looked at LOP and it had that same issue lol.

Pages:<< prev 1 next >>