Login
User Name:

Password:



Register

Forgot your password?
void nanny_get_new_race -- comm.c
Mar 13, 2025 7:08 am
By Elwood
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
SWFotEFUSS 1.5.3
Author: Various
Submitted by: Samson
SWRFUSS 1.4.3
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.8
Author: Various
Submitted by: Samson
AFKMud 2.5.2
Author: AFKMud Team
Submitted by: Samson
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
Users Online
Anthropic, Bing, DotBot

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
507
3,812
19,723
594
Bardecome

» 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,992
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,707
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,992
JoinedJul 26, 2005

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

Pages:<< prev 1 next >>