Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Bing, DotBot, Yandex, Google

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
622
ignatius
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] Hardcoded level checks ...
Forum Rules | Mark all | Recent Posts

[Bug] Hardcoded level checks in various places
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jul 30, 2005, 10:19 am   Last edited Jul 30, 2005, 10:51 am by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Bug: Hardcoded level checks in various places
Danger: Varies by location
Found by: Several people over time
Fixed by: Several other people over time

---

act_info.c, show_char_to_char_0

Locate:
if( IS_IMMORTAL( victim ) && victim->level > 50 )


Replace with:

if( IS_IMMORTAL( victim ) && victim->level > LEVEL_AVATAR )


Locate:
else if( CAN_PKILL( victim ) && victim->level < 51 )


Replace with:
else if( CAN_PKILL( victim ) && victim->level < LEVEL_IMMORTAL )


act_info.c, do_who

Locate:
if( wch->level > 50 && IS_IMMORTAL( wch ) )


Replace with:
if( wch->level > LEVEL_AVATAR && IS_IMMORTAL( wch ) )


Locate:
if( IS_IMMORTAL( victim ) && victim->level > 50 )


Replace with:
if( IS_IMMORTAL( victim ) && victim->level > LEVEL_AVATAR )


mud_comm.c, do_mpinvis

Locate:
if( level < 2 || level > 51 )


Replace with:
if( level < 2 || level > LEVEL_IMMORTAL )


act_comm.c, talk_channel

Locate:
if( ( ch->level < 51 ) && ( channel != CHANNEL_WARTALK ) && ( channel != CHANNEL_CLAN ) )


Replace with:
if( ( ch->level < LEVEL_IMMORTAL ) && ( channel != CHANNEL_WARTALK ) && ( channel != CHANNEL_CLAN ) )


act_comm.c, do_group

Locate:
      ch_printf( ch, "\n\rFollowing %-12.12s     [hitpnts]   [ magic ] [mst] [mvs] [race]%s\n\r",
                 PERS( leader, ch ), ch->level < 50 ? " [to lvl]" : "" );


Replace with:
      ch_printf( ch, "\n\rFollowing %-12.12s     [hitpnts]   [ magic ] [mst] [mvs] [race]%s\n\r",
                 PERS( leader, ch ), ch->level < LEVEL_AVATAR ? " [to lvl]" : "" );


Locate:
if( gch->level < 50 )


Replace with:
if( gch->level < LEVEL_AVATAR )


clans.c, do_council_induct

Locate:
if ( victim->level < 51 )


Replace with:
if ( victim->level < LEVEL_IMMORTAL )


comm.c, nanny

Locate:
         if( ch->level == 50 )
            do_help( ch, "amotd" );
         if( ch->level < 50 && ch->level > 0 )
            do_help( ch, "motd" );


Replace with:
         if( ch->level == LEVEL_AVATAR )
            do_help( ch, "amotd" );
         if( ch->level < LEVEL_AVATAR && ch->level > 0 )
            do_help( ch, "motd" );


act_wiz.c, do_mortalize

Locate:
      victim->level = 50;
      victim->exp = exp_level( victim, 50 );


Replace with:
      victim->level = LEVEL_AVATAR;
      victim->exp = exp_level( victim, LEVEL_AVATAR );


fight.c, check_killer

Locate:
level_ratio = URANGE( 1, ch->level / victim->level, 50 );


Replace with:
level_ratio = URANGE( 1, ch->level / victim->level, LEVEL_AVATAR );


fight.c, raw_kill

Locate:
if( victim->level < 50 )


Replace with:
if( victim->level < LEVEL_AVATAR )


comments.c, do_comment

Locate:
if( ( get_trust( victim ) >= get_trust( ch ) ) || ( get_trust( ch ) < 58 ) )  /* switch to some LEVEL_ thingie */


Replace with:
if( ( get_trust( victim ) >= get_trust( ch ) ) || ( get_trust( ch ) < LEVEL_GOD ) )


Locate:
         if( ( 58 <= get_trust( ch ) ) /* switch to some LEVEL_ thingie */
             && ( vnum == anum ) )


Replace with:
         if( ( LEVEL_GOD <= get_trust( ch ) )
             && ( vnum == anum ) )


The above "metabug" was fixed up by going over every file in the code and looking for the literal strings "50" and "51" which are the common levels for avatar and immortal. The other levels from 52-65 were hunted for the hard way: by using grep. This isn't necessarily going to account for every last possible place there are hardcoded level values, but this should take care of nearly all of the important ones.
       
Pages:<< prev 1 next >>