Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, DotBot

Members: 0
Guests: 19
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
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,639
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 >>