num_skills possible issue.
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Jan 5, 2025 12:52 pm
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 ); } } } }
#2 Jan 6, 2025 4:23 pm
Black Hand
GroupAdministrators
Posts3,713
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.
FWIW, this was added in Smaug 1.4.
#3 Jan 6, 2025 5:38 pm
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 >>